My favorites | Sign in
Project Logo
                
Search
for
Updated Nov 24, 2007 by pelleb
RequestToken  
How the RequestToken api works

Introduction

The RequestToken is used for the Authentication phase of the OAuth protocol

See Spec

This is only used from the ConsumerService side.

RequestToken lifecycle

  1. ConsumerService Request a RequestToken from the ServiceProvider using Consumer
  2. Redirect user to the ServiceProvider's AuthorizationUrl with an appended token
  3. User authorizes the RequestToken
  4. ConsumerService exchanges RequestToken for an AccessToken

Contains

  • token - the actual token string
  • secret - a secret string used for signing requests

Creation

You ask a Consumer object to request the token from the ServiceProvider

@request_token=@consumer.get_request_token

Authorization

Redirect the user to the authorization_url:

redirect_to @request_token.authorization_url

Exchange for AccessToken

Once the user is redirected back to the callback url you can exchange it:

@access_token=@request_token.get_access_token

Sign in to add a comment
Hosted by Google Code