omniauth-sberbank 1.0.4 → 1.0.6

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
  SHA256:
3
- metadata.gz: 645f29b8f8a6caf1db8ce7bea82d793b9b68e56b2fc326cc748ae1f0245c5918
4
- data.tar.gz: e5b0ea606ff2bbaa7d0222bee88acf9b385c80c841ca8a7a037b09b3f1d31f55
3
+ metadata.gz: 5bd58b4d3381b238f837bbd7c8c6f460fa235675db4b66956cffcdc41d51dd34
4
+ data.tar.gz: 92c10d543abe753b8fb93cb23b0e9833c597dbe6f41a6c639fb94af1b5cc9c58
5
5
  SHA512:
6
- metadata.gz: ac81d85944eef8bbf201078a3a410467ffd268a2de3d7f07d24b96411d5b2b06db0ff76df42b84c28d2c176c17aa862ddf12be9e9f4f5ef23c61d394f82286c2
7
- data.tar.gz: b5f6a6002b54a49edd29fff08984544264d194dd07ecf5f8391894886e036b044a0921408b40a006eeaec10bcc21bcc5f75798c18e99192e46fa7084c51f50d6
6
+ metadata.gz: 68068bd737052d230fae01012486a79f74397648d4087505951717a580f8da0e1d290f97611acabc65fd3e98c9e4e703a3042e19c649fddea96d35ba9c8ae193
7
+ data.tar.gz: 64a665a0d418f1cb2af725df93f1410ad792cab555a792b5afbda5308bf6c4da06c8239227afeafc388882fe910ddbf99913ca47804f0108bbacc9af75f3b2e0
@@ -2,13 +2,11 @@
2
2
  require 'uri'
3
3
  require 'openssl'
4
4
  require 'net/http'
5
- require 'pry'
6
5
 
7
6
  class SessionsController < ApplicationController
8
7
  def create
9
8
  Rails.logger.info(request.env['omniauth.auth']) if request.env['omniauth.auth']
10
9
  Rails.logger.info('====================================Everithing is OK! ========================================')
11
- # binding.pry
12
10
  redirect_to '/'
13
11
  end
14
12
 
@@ -1,26 +1,5 @@
1
- require 'pry'
2
- # require 'uri'
3
- # require 'openssl'
4
- # require 'net/http'
5
-
6
1
  class WelcomeController < ApplicationController
7
2
  def index
8
- # url = URI("https://dev.api.sberbank.ru/ru/prod/tokens/v2/oauth")
9
-
10
- # http = Net::HTTP.new(url.host, url.port)
11
- # http.use_ssl = true
12
- # http.verify_mode = OpenSSL::SSL::VERIFY_PEER
13
-
14
- # request = Net::HTTP::Post.new(url)
15
- # request["x-ibm-client-id"] = 'REPLACE_THIS_KEY'
16
- # request["authorization"] = 'REPLACE_THIS_VALUE'
17
- # request["rquid"] = 'REPLACE_THIS_VALUE'
18
- # request["content-type"] = 'application/x-www-form-urlencoded'
19
- # request["accept"] = 'application/json'
20
- # request.body = "grant_type=tonip&scope=ubacarai"
21
-
22
- # response = http.request(request)
23
- # puts response.read_body
24
3
  Rails.logger.info('---------------------------hi! welcome index!')
25
4
  end
26
5
  end
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- require 'pry'
3
2
 
4
3
  OmniAuth.config.logger = Rails.logger
5
4
  OmniAuth.config.add_camelization 'mailru', 'MailRu'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Sberbank
5
- VERSION = '1.0.4'
5
+ VERSION = '1.0.6'
6
6
  end
7
7
  end
@@ -31,7 +31,7 @@ module OmniAuth
31
31
 
32
32
  option :client_options,
33
33
  site: 'https://api.sberbank.ru',
34
- token_url: 'https://api.sberbank.ru/ru/prod/tokens/v2/oidc',
34
+ token_url: 'https://api.sberbank.ru/prod/tokens/v3/oidc',
35
35
  authorize_url: 'https://online.sberbank.ru/CSAFront/oidc/authorize.do'
36
36
 
37
37
  option :authorize_options, %i[scope response_type client_type client_id state nonce]
@@ -51,7 +51,7 @@ module OmniAuth
51
51
  middle_name: raw_info['middle_name'],
52
52
  id: raw_info['sub'],
53
53
  client_host: raw_info['state'],
54
- provider: 'sberbank'
54
+ provider: options.name
55
55
  }
56
56
  end
57
57
 
@@ -66,7 +66,7 @@ module OmniAuth
66
66
  access_token.options[:mode] = :header
67
67
  @raw_info ||= begin
68
68
  state = request.params['state']
69
- result = access_token.get('/ru/prod/sberbankid/v2.1/userinfo', headers: info_headers).parsed
69
+ result = access_token.get('/prod/sberbankid/userinfo/v5/', headers: info_headers).parsed
70
70
  unless result['aud'] == options.client_id
71
71
  raise ArgumentError, "aud in Sber response not equal clien_id. aud = #{result['aud']}"
72
72
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-sberbank
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergei Baksheev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-11 00:00:00.000000000 Z
11
+ date: 2022-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0'
155
155
  requirements: []
156
- rubygems_version: 3.1.2
156
+ rubygems_version: 3.1.6
157
157
  signing_key:
158
158
  specification_version: 4
159
159
  summary: Sberbank OAuth2 Strategy for OmniAuth