Class: Renren2::Strategy::AuthCode

Inherits:
OAuth2::Strategy::AuthCode
  • Object
show all
Defined in:
lib/renren2/strategy/auth_code.rb

Overview

The Authorization Code Strategy

Instance Method Summary collapse

Instance Method Details

#authorize_url(params = {}) ⇒ Object

The authorization URL endpoint of the provider

Parameters:

  • params (Hash) (defaults to: {})

    additional query parameters for the URL



11
12
13
14
# File 'lib/renren2/strategy/auth_code.rb', line 11

def authorize_url(params={})
  params = {:redirect_uri => @client.redirect_uri}.merge(params)
  super params
end

#get_token(code, params = {}, opts = {}) ⇒ Object

Note:

that you must also provide a :redirect_uri with most OAuth 2.0 providers

Retrieve an access token given the specified validation code.

Parameters:

  • code (String)

    The Authorization Code value

  • params (Hash) (defaults to: {})

    additional params

  • opts (Hash) (defaults to: {})

    options



22
23
24
25
# File 'lib/renren2/strategy/auth_code.rb', line 22

def get_token(code, params={}, opts={})
  params = {:redirect_uri => @client.redirect_uri}.merge(params)
  super(code, params, opts)
end