Class: OAuth::RequestToken

Inherits:
ConsumerToken show all
Defined in:
lib/oauth/token.rb

Overview

The RequestToken is used for the initial Request. This is normally created by the Consumer object.

Instance Attribute Summary

Attributes inherited from ConsumerToken

#consumer

Attributes inherited from Token

#secret, #token

Instance Method Summary collapse

Methods inherited from ConsumerToken

#initialize, #request, #sign!

Methods inherited from Token

#initialize, #to_query

Methods included from Helper

#escape, #generate_key

Constructor Details

This class inherits a constructor from OAuth::ConsumerToken

Instance Method Details

#authorize_urlObject

Returns the authorization url that you need to use for redirecting the user



59
60
61
# File 'lib/oauth/token.rb', line 59

def authorize_url
  consumer.authorize_url+"?oauth_token="+CGI.escape(token)
end

#get_access_token(options = {}) ⇒ Object

exchange for AccessToken on server



64
65
66
67
# File 'lib/oauth/token.rb', line 64

def get_access_token(options={})
  response=consumer.token_request(consumer.http_method,consumer.access_token_path,self,options)
  OAuth::AccessToken.new(consumer,response[:oauth_token],response[:oauth_token_secret])
end