class Oauthio::Strategy::AuthCode
Public Class Methods
new(client)
click to toggle source
# File lib/oauthio/strategy/auth_code.rb, line 4 def initialize(client) @client = client end
Public Instance Methods
client_params()
click to toggle source
The OAuth client_id and client_secret
@return [Hash]
# File lib/oauthio/strategy/auth_code.rb, line 25 def client_params {'key' => @client.id, 'secret' => @client.secret} end
get_token(code, params = {}, opts = {})
click to toggle source
Retrieve an access token given the specified validation code.
@param [String] code The Authorization Code value @param [Hash] params additional params @param [Hash] opts options @note that you must also provide a :redirect_uri with most OAuth 2.0 providers
# File lib/oauthio/strategy/auth_code.rb, line 35 def get_token(code, params = {}, opts = {}) params = {'code' => code}.merge(client_params).merge(params) @client.get_token(params, opts) end