Class: OmniAuth::Strategies::AituPassport
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::AituPassport
- Defined in:
- lib/omniauth/strategies/aitu_passport.rb
Overview
AituPassport omniauth provider
Constant Summary collapse
- AVAILABLE_SCOPE_OPTIONS =
%w[ openid phone first_name middle_name last_name birth_date gender id_card_manual residence_address_manual registration_address_manual identification_video_recording sign liveness liveness_3d residence_permit_manual identification_document_manual identification_document_ocr identification_document_mrz idpc_verification wallet_read wallet ].freeze
- DEFAULT_SCOPE =
'openid phone'
- ALLOWED_ISS =
%w[https://passport.test.supreme-team.tech https://passport.aitu.io].freeze
Instance Method Summary collapse
-
#authorize_params ⇒ Object
Omniauth::Strategies::Oauth2.
-
#initialize(app, *args, &block) ⇒ AituPassport
constructor
Omniauth::Strategy.
- #raw_info ⇒ Object
Constructor Details
#initialize(app, *args, &block) ⇒ AituPassport
Omniauth::Strategy
94 95 96 97 98 99 100 101 102 |
# File 'lib/omniauth/strategies/aitu_passport.rb', line 94 def initialize(app, *args, &block) # Setting up corresponding options super.tap do # Raising up an error if redirect_uri is missing raise ArgumentError, 'Wrong options: redirect_uri option is missing.' unless [:redirect_uri] [:client_options][:site] = 'https://passport.test.supreme-team.tech' if ENV['PASSPORT_STAGING'] end end |
Instance Method Details
#authorize_params ⇒ Object
Omniauth::Strategies::Oauth2
105 106 107 108 109 110 111 |
# File 'lib/omniauth/strategies/aitu_passport.rb', line 105 def super.tap do |params| params[:scope] = filter_scope(params) params[:redirect_uri] = [:redirect_uri] params[:session_id] = get_session_id end end |
#raw_info ⇒ Object
113 114 115 |
# File 'lib/omniauth/strategies/aitu_passport.rb', line 113 def raw_info @raw_info ||= access_token.get('/userinfo').parsed end |