omniauth-proxy 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth/strategies/proxy.rb +6 -2
- data/lib/omniauth_proxy/version.rb +1 -1
- data/lib/omniauth_proxy.rb +10 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a533b3d02145970eb0befa251c2720b18251aa40ed52f6b40182cd7b64430a15
|
4
|
+
data.tar.gz: 962cc9dc9f37d9ed5406448b8147f43e8821dafef7272390639fb2927c605eec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28a49cdad6c1e170eefdc5a012fe326e9944c04f43e470169b0f2b395a5176015d253104bca3bd1e794b7b0ab401bb6ad118b4e15875020f114fd5ae467878b1
|
7
|
+
data.tar.gz: 38936039a6eadec3489df6ccea5b148aeec443aa7acffd2f9891cc3839d6ca6c533c6744efdefc8465208cfb2f323d61daae8cd6fca77ab446b05c2e62f15b6e
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module OmniAuth
|
2
2
|
module Strategies
|
3
3
|
class Proxy
|
4
|
-
PROXY_PATH = "https://
|
4
|
+
PROXY_PATH = "https://oauth-proxy.fly.dev/proxy"
|
5
5
|
|
6
6
|
def initialize(app, _options={})
|
7
7
|
@app = app
|
@@ -13,7 +13,7 @@ module OmniAuth
|
|
13
13
|
if ENV["OMNIAUTH_PROXY_ENABLED"].present? && status == 302
|
14
14
|
location = headers["Location"]
|
15
15
|
|
16
|
-
if is_google?(location) || is_github?(location)
|
16
|
+
if is_google?(location) || is_github?(location) || is_auth0?(location)
|
17
17
|
headers["Location"] = proxy_uri(location)
|
18
18
|
end
|
19
19
|
end
|
@@ -29,6 +29,10 @@ module OmniAuth
|
|
29
29
|
location.match?("https://github.com/login/oauth/authorize")
|
30
30
|
end
|
31
31
|
|
32
|
+
def is_auth0?(location)
|
33
|
+
location.match?("auth0.com/authorize")
|
34
|
+
end
|
35
|
+
|
32
36
|
def proxy_uri(location)
|
33
37
|
encoded_uri = Base64.urlsafe_encode64(location)
|
34
38
|
PROXY_PATH + "?uri=" + encoded_uri
|
data/lib/omniauth_proxy.rb
CHANGED
@@ -11,6 +11,16 @@ if ENV["OMNIAUTH_PROXY_ENABLED"].present?
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
14
|
+
|
15
|
+
if defined?(OmniAuth::Strategies::Auth0)
|
16
|
+
p "Patching Auth0 OmniAuth Strategy"
|
17
|
+
|
18
|
+
class OmniAuth::Strategies::Auth0
|
19
|
+
def callback_url
|
20
|
+
request.params['redirect_uri'] || super
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
14
24
|
end
|
15
25
|
|
16
26
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuva
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -90,7 +90,7 @@ homepage: https://oproxy.herokuapp.com
|
|
90
90
|
licenses:
|
91
91
|
- MIT
|
92
92
|
metadata: {}
|
93
|
-
post_install_message:
|
93
|
+
post_install_message:
|
94
94
|
rdoc_options: []
|
95
95
|
require_paths:
|
96
96
|
- lib
|
@@ -105,8 +105,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
|
-
rubygems_version: 3.
|
109
|
-
signing_key:
|
108
|
+
rubygems_version: 3.4.10
|
109
|
+
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: Proxy OmniAuth request/callback cycles.
|
112
112
|
test_files: []
|