omniauth-apple 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rakeTasks +7 -0
- data/lib/omniauth/apple/version.rb +1 -1
- data/lib/omniauth/strategies/apple.rb +17 -6
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9209606bc989d401e7a3b4df233f14b0d126a25a8e5fa4aaf39e52bdc86f8518
|
|
4
|
+
data.tar.gz: 863dbd6c01b45573d5e2fba5fc84078bff8415a265c4e99098495d49737b4bb2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ec26c40908a1c669daa5adb25d985ce9d583466544e35094d0dc81089a3fe973bc71f1182cdbbe83614aa426de3a99560f28691d3f35b9641969d8c824b28511
|
|
7
|
+
data.tar.gz: b51d3b1ea9738f76cdc383cb5a616fe71b4d1e0a3acb72f16145e5c1d71556d0b0082d6b724a3c9c82c8ab28e8c3711c4489772a00b897941896a881e7d82aaa
|
data/.rakeTasks
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
|
3
|
+
You are allowed to:
|
|
4
|
+
1. Remove rake task
|
|
5
|
+
2. Add existing rake tasks
|
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
|
|
@@ -13,7 +13,8 @@ module OmniAuth
|
|
|
13
13
|
token_url: '/auth/token'
|
|
14
14
|
option :authorize_params,
|
|
15
15
|
response_mode: 'form_post'
|
|
16
|
-
|
|
16
|
+
option :authorized_client_ids, []
|
|
17
|
+
|
|
17
18
|
uid { id_info['sub'] }
|
|
18
19
|
|
|
19
20
|
info do
|
|
@@ -32,7 +33,7 @@ module OmniAuth
|
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
def client
|
|
35
|
-
::OAuth2::Client.new(
|
|
36
|
+
::OAuth2::Client.new(client_id, client_secret, deep_symbolize(options.client_options))
|
|
36
37
|
end
|
|
37
38
|
|
|
38
39
|
def callback_url
|
|
@@ -42,9 +43,19 @@ module OmniAuth
|
|
|
42
43
|
private
|
|
43
44
|
|
|
44
45
|
def id_info
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
if request.params&.key?('id_token') || access_token&.params&.key?('id_token')
|
|
47
|
+
id_token = request.params['id_token'] || access_token.params['id_token']
|
|
48
|
+
log(:info, "id_token: #{id_token}")
|
|
49
|
+
@id_info ||= ::JWT.decode(id_token, nil, false)[0] # payload after decoding
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def client_id
|
|
54
|
+
unless id_info.nil?
|
|
55
|
+
return id_info['aud'] if options.authorized_client_ids.include? id_info['aud']
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
options.client_id
|
|
48
59
|
end
|
|
49
60
|
|
|
50
61
|
def user_info
|
|
@@ -70,7 +81,7 @@ module OmniAuth
|
|
|
70
81
|
payload = {
|
|
71
82
|
iss: options.team_id,
|
|
72
83
|
aud: 'https://appleid.apple.com',
|
|
73
|
-
sub:
|
|
84
|
+
sub: client_id,
|
|
74
85
|
iat: Time.now.to_i,
|
|
75
86
|
exp: Time.now.to_i + 60
|
|
76
87
|
}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-apple
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- nhosoya
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2020-
|
|
12
|
+
date: 2020-05-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: omniauth-oauth2
|
|
@@ -76,6 +76,7 @@ extensions: []
|
|
|
76
76
|
extra_rdoc_files: []
|
|
77
77
|
files:
|
|
78
78
|
- ".gitignore"
|
|
79
|
+
- ".rakeTasks"
|
|
79
80
|
- Gemfile
|
|
80
81
|
- LICENSE
|
|
81
82
|
- README.md
|
|
@@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
106
107
|
- !ruby/object:Gem::Version
|
|
107
108
|
version: '0'
|
|
108
109
|
requirements: []
|
|
109
|
-
rubygems_version: 3.
|
|
110
|
+
rubygems_version: 3.0.3
|
|
110
111
|
signing_key:
|
|
111
112
|
specification_version: 4
|
|
112
113
|
summary: OmniAuth strategy for Sign In with Apple
|