class OAuth2::Strategy::TokenExchange

The Token Exchange strategy

@see tools.ietf.org/html/draft-ietf-oauth-token-exchange-03#section-4.1

Constants

GRANT_TYPE

Public Instance Methods

authorize_url() click to toggle source

Not used for this strategy

@raise [NotImplementedError]

# File lib/oauth2/strategy/token_exchange.rb, line 12
def authorize_url
  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 = {}) click to toggle source

Retrieve an access token given the specified End User username and password.

@param [String] username the End User username @param [String] password the End User password @param [Hash] params additional params

# File lib/oauth2/strategy/token_exchange.rb, line 21
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(client_params).merge(params)
  @client.get_token(params, opts)
end