Class: OAuth::RequestToken

### Home Classes Methods

### In Files

- lib/oauth/tokens/request_token.rb

### Parent

OAuth::ConsumerToken

### Methods

- #authorize_url
- #build_authorize_url
- #callback_confirmed?
- #get_access_token

### Files

- LICENSE
- README.rdoc
- TODO

### Class/Module Index

Quicksearch

- OAuth
- OAuth::AccessToken
- OAuth::CLI
- OAuth::Client
- OAuth::Client::Helper
- OAuth::Consumer
- OAuth::ConsumerToken
- OAuth::Error
- OAuth::Helper
- OAuth::OAuthTestHelper
- OAuth::Problem
- OAuth::RequestProxy
- OAuth::RequestProxy::ActionControllerRequest
- OAuth::RequestProxy::Base
- OAuth::RequestProxy::Curl
- OAuth::RequestProxy::Curl::Easy
- OAuth::RequestProxy::EventMachine
- OAuth::RequestProxy::EventMachine::HttpRequest
- OAuth::RequestProxy::JabberRequest
- OAuth::RequestProxy::MockRequest
- OAuth::RequestProxy::Net
- OAuth::RequestProxy::Net::HTTP
- OAuth::RequestProxy::Net::HTTP::HTTPRequest
- OAuth::RequestProxy::RackRequest
- OAuth::RequestProxy::Typhoeus
- OAuth::RequestProxy::Typhoeus::Request
- OAuth::RequestProxy::UnknownRequestType
- OAuth::RequestToken
- OAuth::Server
- OAuth::ServerToken
- OAuth::Signature
- OAuth::Signature::Base
- OAuth::Signature::HMAC
- OAuth::Signature::HMAC::Base
- OAuth::Signature::HMAC::MD5
- OAuth::Signature::HMAC::RMD160
- OAuth::Signature::HMAC::SHA1
- OAuth::Signature::HMAC::SHA2
- OAuth::Signature::MD5
- OAuth::Signature::PLAINTEXT
- OAuth::Signature::RSA
- OAuth::Signature::RSA::SHA1
- OAuth::Signature::SHA1
- OAuth::Signature::UnknownSignatureMethod
- OAuth::Token
- OAuth::Unauthorized
- ActionController
- ActionController::Base
- ActionController::TestRequest
- Digest
- Digest::HMAC
- EventMachine
- EventMachine::HttpClient
- Net
- Net::HTTPGenericRequest
- Object
- String

No matching classes.

# 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
    def authorize_url(params = nil)
      params = (params || {}).merge(:oauth_token => self.token)
      build_authorize_url(consumer.authorize_url, params)
    end

callback_confirmed?() click to toggle source

    # File lib/oauth/tokens/request_token.rb, line 12
    def callback_confirmed?
      params[:oauth_callback_confirmed] == "true"
    end

get_access_token(options = {}, *arguments) click to toggle source

exchange for AccessToken on server

    # File lib/oauth/tokens/request_token.rb, line 17
    def get_access_token(options = {}, *arguments)
      response = consumer.token_request(consumer.http_method, (consumer.access_token_url? ? consumer.access_token_url : consumer.access_token_path), self, options, *arguments)
      OAuth::AccessToken.from_hash(consumer, response)
    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
    def build_authorize_url(base_url, params)
      uri = URI.parse(base_url.to_s)
      # TODO doesn't handle array values correctly
      uri.query = params.map { |k,v| [k, CGI.escape(v)] * "=" } * "&"
      uri.to_s
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.