Class: OmniAuth::Strategies::Daccount
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Daccount
- Defined in:
- lib/omniauth/strategies/daccount.rb
Constant Summary collapse
- BASE_SCOPES =
required scope.
"openid"
- AUTH_IF =
0: Authenticate with contract account only, 1: Authenticate with all account.
1
Instance Method Summary collapse
- #authorize_params ⇒ Object
- #callback_phase ⇒ Object
- #callback_url ⇒ Object
- #raw_info ⇒ Object
- #request_phase ⇒ Object
- #token_params ⇒ Object
Instance Method Details
#authorize_params ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/omniauth/strategies/daccount.rb', line 37 def super.tap do |params| [:authorize_options].each do |k| params[k] = request.params[k.to_s] unless [nil, ''].include?(request.params[k.to_s]) end params[:scope] = BASE_SCOPES params[:authif] = AUTH_IF params[:nonce] = params[:state] session['omniauth.state'] = params[:state] if params[:state] end end |
#callback_phase ⇒ Object
53 54 55 |
# File 'lib/omniauth/strategies/daccount.rb', line 53 def callback_phase super end |
#callback_url ⇒ Object
77 78 79 |
# File 'lib/omniauth/strategies/daccount.rb', line 77 def callback_url full_host + script_name + callback_path end |
#raw_info ⇒ Object
72 73 74 75 |
# File 'lib/omniauth/strategies/daccount.rb', line 72 def raw_info access_token.[:mode] = :header @raw_info ||= access_token.get('/common/userinfo').parsed end |
#request_phase ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/omniauth/strategies/daccount.rb', line 29 def request_phase .[:headers] = { "Content-Type" => "application/x-www-form-urlencoded", "Host" => full_host } super end |
#token_params ⇒ Object
49 50 51 |
# File 'lib/omniauth/strategies/daccount.rb', line 49 def token_params super end |