Class: OAuth::RequestToken
- Inherits:
-
ConsumerToken
- Object
- Token
- ConsumerToken
- OAuth::RequestToken
- Defined in:
- lib/oauth/tokens/request_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
Attributes inherited from Token
Instance Method Summary collapse
- #authenticate_url(params = nil) ⇒ Object
-
#authorize_url(params = nil) ⇒ Object
Generate an authorization URL for user authorization.
- #callback_confirmed? ⇒ Boolean
-
#get_access_token(options = {}, *arguments) ⇒ Object
exchange for AccessToken on server.
Methods inherited from ConsumerToken
from_hash, #initialize, #request, #sign!
Methods inherited from Token
Methods included from Helper
_escape, escape, generate_key, generate_timestamp, normalize, normalize_nested_query, parse_header, stringify_keys, unescape
Constructor Details
This class inherits a constructor from OAuth::ConsumerToken
Instance Method Details
#authenticate_url(params = nil) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/oauth/tokens/request_token.rb', line 15 def authenticate_url(params = nil) return nil if token.nil? params = (params || {}).merge(oauth_token: token) build_url(consumer.authenticate_url, params) end |
#authorize_url(params = nil) ⇒ Object
Generate an authorization URL for user authorization
8 9 10 11 12 13 |
# File 'lib/oauth/tokens/request_token.rb', line 8 def (params = nil) return nil if token.nil? params = (params || {}).merge(oauth_token: token) build_url(consumer., params) end |
#callback_confirmed? ⇒ Boolean
22 23 24 |
# File 'lib/oauth/tokens/request_token.rb', line 22 def callback_confirmed? params[:oauth_callback_confirmed] == "true" end |
#get_access_token(options = {}, *arguments) ⇒ Object
exchange for AccessToken on server
27 28 29 30 31 |
# File 'lib/oauth/tokens/request_token.rb', line 27 def get_access_token( = {}, *arguments) response = consumer.token_request(consumer.http_method, (consumer.access_token_url? ? consumer.access_token_url : consumer.access_token_path), self, , *arguments) OAuth::AccessToken.from_hash(consumer, response) end |