omniauth-bolt 0.0.0 → 0.3.0
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/bolt.rb +15 -9
- data/lib/omniauth-bolt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c04af3a73534c52b17d5aec1c415b9cd7fed4f48f0bc8a2998352b0f2caec7d
|
4
|
+
data.tar.gz: 5f4603ca5b9c1280781ae163bed7c0e4a45c1b3bdb11a13f099617261cbd41fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dd087adebaf81428676f982bd2e6376e04578b5747d0e3ee5661639709e8b6da40d2dce44656b3fe6c4d32764be88a6add13e751affbb6696a15f71786dfbed
|
7
|
+
data.tar.gz: 58b2aafe0671c21b2a17e8823dec526d457f0319aa93c557ae40dcc4e94a92971d87e03ed4f17428a571d75283f17d9aa602eb1fd8bfe1d990ee3acec1529bc9
|
@@ -30,24 +30,22 @@ module OmniAuth
|
|
30
30
|
}
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
session[:authorization_code] = request.params['authorization_code']
|
39
|
-
session[:scope] = request.params['scope']
|
33
|
+
def query_string
|
34
|
+
authorization_code = request.params['code'] || request.params['authorization_code']
|
35
|
+
"?authorization_code=#{authorization_code}&scope=#{request.params['scope']}&state=#{request.params['state']}"
|
36
|
+
end
|
40
37
|
|
38
|
+
def request_phase
|
41
39
|
redirect callback_url
|
42
40
|
end
|
43
41
|
|
44
42
|
def callback_phase
|
45
43
|
payload = {
|
46
44
|
grant_type: 'authorization_code',
|
47
|
-
code:
|
45
|
+
code: request.params['authorization_code'],
|
48
46
|
client_id: options['publishable_key'],
|
49
47
|
# scope: 'openid+bolt.account.manage',
|
50
|
-
scope:
|
48
|
+
scope: request.params['scope'],
|
51
49
|
client_secret: options['api_key']
|
52
50
|
}
|
53
51
|
|
@@ -64,9 +62,17 @@ module OmniAuth
|
|
64
62
|
post_data = URI.encode_www_form(payload)
|
65
63
|
res = http.request(req, post_data)
|
66
64
|
response = JSON.parse(res.body)
|
65
|
+
|
66
|
+
@expiration_time = Time.now.utc + response['expires_in']
|
67
|
+
@refresh_token = response['refresh_token']
|
68
|
+
@refresh_token_scope = response['refresh_token_scope']
|
67
69
|
@access_token = response['access_token']
|
68
70
|
@user_uid = response['id_token']
|
69
71
|
|
72
|
+
# don't need these values to refresh access_token so better remove them
|
73
|
+
session.delete('authorization_code')
|
74
|
+
session.delete('scope')
|
75
|
+
|
70
76
|
super
|
71
77
|
end
|
72
78
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-bolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniele Palombo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth
|