Class: OAuth2::Strategy::TokenExchange
- Inherits:
-
Base
- Object
- Base
- OAuth2::Strategy::TokenExchange
- Defined in:
- lib/oauth2/strategy/token_exchange.rb
Overview
The Token Exchange strategy
Constant Summary collapse
- GRANT_TYPE =
'urn:ietf:params:oauth:grant-type:token-exchange'
Instance Method Summary collapse
-
#authorize_url ⇒ Object
Not used for this strategy.
-
#get_token(actor_token, actor_token_type, subject_token, subject_token_type, params = {}, opts = {}) ⇒ Object
Retrieve an access token given the specified End User username and password.
Instance Method Details
#authorize_url ⇒ Object
Not used for this strategy
13 14 15 |
# File 'lib/oauth2/strategy/token_exchange.rb', line 13 def fail(NotImplementedError, 'The authorization endpoint is not used in this strategy') end |
#get_token(actor_token, actor_token_type, subject_token, subject_token_type, params = {}, opts = {}) ⇒ Object
Retrieve an access token given the specified End User username and password.
22 23 24 25 26 27 28 29 30 |
# File 'lib/oauth2/strategy/token_exchange.rb', line 22 def get_token(actor_token, actor_token_type, subject_token, subject_token_type, params = {}, opts = {}) params = {'grant_type' => GRANT_TYPE, 'actor_token' => actor_token, 'actor_token_type' => actor_token_type, 'subject_token' => subject_token, 'subject_token_type' => subject_token_type }.merge(params) @client.get_token(params, opts) end |