Class: OAuth2::Strategy::Implicit
- Defined in:
- lib/oauth2/strategy/implicit.rb,
sig/oauth2/strategy.rbs
Overview
The Implicit Strategy
IMPORTANT (OAuth 2.1): The Implicit grant (response_type=token) is omitted from the OAuth 2.1 draft specification. It remains here for backward compatibility with OAuth 2.0 providers. Prefer the Authorization Code flow with PKCE.
References:
Instance Method Summary collapse
-
#authorize_params(params = {}) ⇒ Hash[untyped, untyped]
The required query parameters for the authorize URL.
-
#authorize_url(params = {}) ⇒ String
The authorization URL endpoint of the provider.
-
#get_token ⇒ void
Not used for this strategy.
Methods inherited from Base
Constructor Details
This class inherits a constructor from OAuth2::Strategy::Base
Instance Method Details
#authorize_params(params = {}) ⇒ Hash[untyped, untyped]
The required query parameters for the authorize URL
20 21 22 |
# File 'lib/oauth2/strategy/implicit.rb', line 20 def (params = {}) params.merge("response_type" => "token", "client_id" => @client.id) end |
#authorize_url(params = {}) ⇒ String
The authorization URL endpoint of the provider
27 28 29 30 |
# File 'lib/oauth2/strategy/implicit.rb', line 27 def (params = {}) assert_valid_params(params) @client.(.merge(params)) end |
#get_token ⇒ void
This method returns an undefined value.
Not used for this strategy
35 36 37 |
# File 'lib/oauth2/strategy/implicit.rb', line 35 def get_token(*) raise(NotImplementedError, "The token is accessed differently in this strategy") end |