Class: OmniAuth::Strategies::Auth0
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Auth0
- Includes:
- Auth0::Telemetry
- Defined in:
- lib/omniauth/strategies/auth0.rb
Overview
Auth0 OmniAuth strategy
Instance Method Summary collapse
-
#authorize_params ⇒ Object
Define the parameters used for the /authorize endpoint.
- #build_access_token ⇒ Object
-
#client ⇒ Object
Setup client URLs used during authentication.
-
#request_phase ⇒ Object
Declarative override for the request phase of authentication.
Methods included from Auth0::Telemetry
#telemetry, #telemetry_encoded
Instance Method Details
#authorize_params ⇒ Object
Define the parameters used for the /authorize endpoint
78 79 80 81 82 83 84 |
# File 'lib/omniauth/strategies/auth0.rb', line 78 def params = super parsed_query = Rack::Utils.parse_query(request.query_string) params['connection'] = parsed_query['connection'] params['prompt'] = parsed_query['prompt'] params end |
#build_access_token ⇒ Object
86 87 88 89 |
# File 'lib/omniauth/strategies/auth0.rb', line 86 def build_access_token .token_params[:headers] = { 'Auth0-Client' => telemetry_encoded } super end |
#client ⇒ Object
Setup client URLs used during authentication
24 25 26 27 28 29 30 |
# File 'lib/omniauth/strategies/auth0.rb', line 24 def client ..site = domain_url .. = '/authorize' ..token_url = '/oauth/token' ..userinfo_url = '/userinfo' super end |
#request_phase ⇒ Object
Declarative override for the request phase of authentication
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/omniauth/strategies/auth0.rb', line 92 def request_phase if no_client_id? # Do we have a client_id for this Application? fail!(:missing_client_id) elsif no_client_secret? # Do we have a client_secret for this Application? fail!(:missing_client_secret) elsif no_domain? # Do we have a domain for this Application? fail!(:missing_domain) else # All checks pass, run the Oauth2 request_phase method. super end end |