Class: OmniAuth::Strategies::Jumpseller
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Jumpseller
- Defined in:
- lib/omniauth/strategies/jumpseller.rb
Constant Summary collapse
- AUTHENTICATION_PARAMETERS =
%w(state app)
- BASE_URL =
'http://localhost:3000'
Instance Method Summary collapse
-
#authorize_params ⇒ Object
You can pass
display
,state
orscope
params to the auth request, if you need to set them dynamically. -
#callback_phase ⇒ Object
# Hook used after response with code from provider.
-
#callback_url ⇒ Object
Over-ride callback_url definition to maintain compatability with omniauth-oauth2 >= 1.4.0.
- #me ⇒ Object
-
#request_phase ⇒ Object
# Hook useful for appending parameters into the auth url before sending # to provider.
Instance Method Details
#authorize_params ⇒ Object
You can pass display
, state
or scope
params to the auth request, if you need to set them dynamically. You can also set these options in the OmniAuth config :authorize_params option.
/v1/auth/digialocean?display=fancy&state=ABC
75 76 77 78 79 80 81 |
# File 'lib/omniauth/strategies/jumpseller.rb', line 75 def super.tap do |params| AUTHENTICATION_PARAMETERS.each do |v| params[v.to_sym] = request.params[v] if request.params[v] end end end |
#callback_phase ⇒ Object
# Hook used after response with code from provider. Used to prep token # request from provider.
64 65 66 |
# File 'lib/omniauth/strategies/jumpseller.rb', line 64 def callback_phase super end |
#callback_url ⇒ Object
Over-ride callback_url definition to maintain compatability with omniauth-oauth2 >= 1.4.0
52 53 54 |
# File 'lib/omniauth/strategies/jumpseller.rb', line 52 def callback_url full_host + script_name + callback_path end |
#me ⇒ Object
44 45 46 |
# File 'lib/omniauth/strategies/jumpseller.rb', line 44 def me @response ||= access_token.get('/api/v1/me').parsed end |
#request_phase ⇒ Object
# Hook useful for appending parameters into the auth url before sending # to provider.
58 59 60 |
# File 'lib/omniauth/strategies/jumpseller.rb', line 58 def request_phase super end |