OAuth::RequestToken

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

Public Instance Methods

authorize_url(params = nil) click to toggle source

Generate an authorization URL for user authorization

    # File lib/oauth/tokens/request_token.rb, line 7
 7:     def authorize_url(params = nil)
 8:       params = (params || {}).merge(:oauth_token => self.token)
 9:       build_authorize_url(consumer.authorize_url, params)
10:     end
callback_confirmed?() click to toggle source
    # File lib/oauth/tokens/request_token.rb, line 12
12:     def callback_confirmed?
13:       params[:oauth_callback_confirmed] == "true"
14:     end
get_access_token(options = {}, *arguments) click to toggle source

exchange for AccessToken on server

    # File lib/oauth/tokens/request_token.rb, line 17
17:     def get_access_token(options = {}, *arguments)
18:       response = consumer.token_request(consumer.http_method, (consumer.access_token_url? ? consumer.access_token_url : consumer.access_token_path), self, options, *arguments)
19:       OAuth::AccessToken.from_hash(consumer, response)
20:     end

Protected Instance Methods

build_authorize_url(base_url, params) click to toggle source

construct an authorization url

    # File lib/oauth/tokens/request_token.rb, line 25
25:     def build_authorize_url(base_url, params)
26:       uri = URI.parse(base_url.to_s)
27:       # TODO doesn't handle array values correctly
28:       uri.query = params.map { |k,v| [k, CGI.escape(v)] * "=" } * "&"
29:       uri.to_s
30:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.