authkeeper 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7e3d45ae7bcca438a4237c560263cba833d3d41c9dae190345f9fb45851a2ba
|
4
|
+
data.tar.gz: 13a0894bf0629edc822a341a150e34868f11e1bea9ea8716cf83ac75295ec3b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f5f3223c51f25c51e54949b84c3cf4485f8337f22956bb9170b61bb219508ae68fb5b9087ab64dee59bed0d1d93c3835f754217c88024a2d4bf893106ca0e0f
|
7
|
+
data.tar.gz: 6f62a8506fd37f9bcaf8240629ef027d78406f8df2535021994a36b289700b55e8ab985feba0001cce11731f96137be904ac8e51139f39a1076a07a9011a49b8
|
@@ -5,7 +5,7 @@ require 'uri'
|
|
5
5
|
module Authkeeper
|
6
6
|
module VkAuthApi
|
7
7
|
module Requests
|
8
|
-
module
|
8
|
+
module AccessToken
|
9
9
|
def fetch_access_token(client_id:, redirect_url:, device_id:, code:, state:, code_verifier:)
|
10
10
|
post(
|
11
11
|
path: 'oauth2/auth',
|
@@ -23,6 +23,22 @@ module Authkeeper
|
|
23
23
|
}
|
24
24
|
)
|
25
25
|
end
|
26
|
+
|
27
|
+
def refresh_access_token(client_id:, refresh_token:, device_id:, state:)
|
28
|
+
post(
|
29
|
+
path: 'oauth2/auth',
|
30
|
+
body: URI.encode_www_form({
|
31
|
+
grant_type: 'refresh_token',
|
32
|
+
client_id: client_id,
|
33
|
+
device_id: device_id,
|
34
|
+
refresh_token: refresh_token,
|
35
|
+
state: state
|
36
|
+
}),
|
37
|
+
headers: {
|
38
|
+
'Content-Type' => 'application/x-www-form-urlencoded'
|
39
|
+
}
|
40
|
+
)
|
41
|
+
end
|
26
42
|
end
|
27
43
|
end
|
28
44
|
end
|
@@ -17,7 +17,7 @@ module Authkeeper
|
|
17
17
|
# "expires_in" => 3600,
|
18
18
|
# "user_id" => 176780000,
|
19
19
|
# "state" => "ce4a09792e2cc8065a96074906709765",
|
20
|
-
# "scope" => "vkid.personal_info email"
|
20
|
+
# "scope" => "vkid.personal_info email phone ads"
|
21
21
|
# }
|
22
22
|
|
23
23
|
user_info = fetch_user_info(auth_info['access_token'])
|
@@ -36,7 +36,7 @@ module Authkeeper
|
|
36
36
|
|
37
37
|
{
|
38
38
|
result: {
|
39
|
-
auth_info: auth_info.symbolize_keys,
|
39
|
+
auth_info: auth_info.symbolize_keys.merge(device_id: params[:device_id]),
|
40
40
|
user_info: {
|
41
41
|
uid: user_info.dig('user', 'user_id'),
|
42
42
|
provider: 'vk',
|
data/lib/authkeeper/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authkeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bogdanov Anton
|
@@ -53,7 +53,7 @@ files:
|
|
53
53
|
- app/lib/authkeeper/google_auth_api/requests/fetch_access_token.rb
|
54
54
|
- app/lib/authkeeper/jwt_encoder.rb
|
55
55
|
- app/lib/authkeeper/vk_auth_api/client.rb
|
56
|
-
- app/lib/authkeeper/vk_auth_api/requests/
|
56
|
+
- app/lib/authkeeper/vk_auth_api/requests/access_token.rb
|
57
57
|
- app/lib/authkeeper/vk_auth_api/requests/info.rb
|
58
58
|
- app/lib/authkeeper/yandex_api/client.rb
|
59
59
|
- app/lib/authkeeper/yandex_api/requests/info.rb
|