omniauth-icos 1.0.6 → 1.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c70d3a121648078ac962f604302607d3bf479761
4
- data.tar.gz: ebfac26c55bd1c614b75e704ef48e623dbe309c3
3
+ metadata.gz: b795896cd4905a2cd4b3d8cb0989c66a1164af05
4
+ data.tar.gz: 4500f59056f0f1da1fa7c6360ddb1e44acf3d19a
5
5
  SHA512:
6
- metadata.gz: 031543e2f966eebc79c60b1da78591920f27ad3a3508ef554396497eb9f4d943e1a3fd9aff7a11a71c5c853be726ca48ac1404f07fc2d39d3505a7a6844c36a2
7
- data.tar.gz: 9814c558980a4d5dcb4d8e26e2c2df06f40e9c853af9ca94d6f9460f109d7155ef9d3e650577c2cba69ead3badf1ba071bccb5e083f6cefc6771762a5c89de27
6
+ metadata.gz: e62ad39e09309713180da76ae5b7afff296775f0d7d29ac00257684514b55208fe2e24f01ca17a538b92d2155aac3ac9f6345782421478d46b89666af2a241cd
7
+ data.tar.gz: 0f57e4afcda78a7025ac155260a9ac6453a1b18d07915c2a98ab3e83a9862578979c19b2bd05a80778418ce3c6e97fd568b999b50fe8b85f5405cf5f445da97e
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module ICOS
3
- VERSION = '1.0.6'
3
+ VERSION = '1.0.7'
4
4
  end
5
5
  end
@@ -11,7 +11,7 @@ module OmniAuth
11
11
 
12
12
  option :client_options, {
13
13
  authorize_url: '/oauth2/auth',
14
- token_url: '/v1/consents/exchange',
14
+ token_url: '/oauth2/token',
15
15
  site: 'https://icosid.com'
16
16
  }
17
17
 
@@ -63,40 +63,6 @@ module OmniAuth
63
63
  options[:redirect_uri] || (full_host + script_name + callback_path)
64
64
  end
65
65
 
66
- def build_access_token
67
- params = ::OAuth2::Authenticator.new(client.id, client.secret, :request_body).apply(
68
- {
69
- 'Redirect' => callback_url,
70
- 'ClientId' => options[:client_id],
71
- 'ClientSecret' => options[:client_secret],
72
- 'Scopes' => DEFAULT_SCOPES,
73
- 'Code' => request.params['code']
74
- }
75
- )
76
-
77
- opts = {
78
- :raise_errors => options[:raise_errors],
79
- :parse => params.delete(:parse),
80
- :body => params,
81
- :headers => { 'Content-Type' => 'application/x-www-form-urlencoded' }
82
- }
83
-
84
- headers = params.delete(:headers) || {}
85
- opts[:headers].merge!(headers)
86
-
87
- response = client.request(:post, client.token_url, opts)
88
-
89
- if !response.parsed.is_a?(Hash) || !response.parsed['Result'] || !response.parsed['Result']['access_token']
90
- error = ::OmniAuth::Error.new(response)
91
- raise(error)
92
- end
93
-
94
- body = response.parsed['Result']
95
- body['expires_at'] = body['expiry'].to_datetime.in_time_zone
96
-
97
- ::OAuth2::AccessToken.from_hash(client, body)
98
- end
99
-
100
66
  def compact_full_name
101
67
  [user_info['FirstName'], user_info['MiddleName'], user_info['LastName']].reject { |name| name.empty? }.join(' ')
102
68
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-icos
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikita Anistratenko