Search Results

OAuth 1.0a Authorization Header

OAuth 1.0a uses the Authorization header as a way to authenticate the client to the OAuth Provider itself. In OAuth 2.0, this header isn't used for authentication with the OAuth Provider. Instead, OAuth 2.0 uses query parameters in the payload.

Both OAuth versions use the Authorization header when sending API requests to the Resource Server.

Protocol parameters can be transmitted using the HTTP "Authorization" header field as
defined by [RFC2617] with the auth-scheme name set to "OAuth" (case insensitive).
For example:
Authorization: OAuth realm="Example",
oauth_consumer_key="0685bd9184jfhq22",
oauth_token="ad180jjd733klru7",
oauth_signature_method="HMAC-SHA1",
oauth_signature="wOJIO9A2W5mFwDgiDvZbTSMK%2FPY%3D",
oauth_timestamp="137131200",
oauth_nonce="4572616e48616d6d65724c61686176",
oauth_version="1.0"

The sections below show differences between how the Authorization header is used at different stages of the OAuth 1.0a message exchange process.

Step 1: Requesting and Receiving a Request Token

Description:

Identifies the client (oauth_consumer_key), identifies the signature method used; uniquely identifies the message with a timestamp and nonce; specifies the URL the user will be redirected back to after authentication (oauth_callback); includes a signature.

In some cases where certain standard OAuth activities are supported by both POST and GET operations, the key values can be sent in query parameters for GET, in the payload for POST, or in the Authorization header in both cases.

Parameter definitions

Below are the parameters that might be part of the OAuth 1.0a Authorization header, and their definitions.

An absolute URI back to which the server will redirect the resource owner when the Resource Owner Authorization is completed. If the client is unable to receive callbacks or a callback URI has been established via other means, the parameter value MUST be set to "oob" (case sensitive), to indicate an out-of-band configuration.

oauth_consumer_key

The client identifier.

oauth_nonce

The random nonce value. The nonce value must be unique across all requests with the same timestamp, client credentials, and token combinations.

The signature base string: a consistent, reproducible concatenation of several of the HTTP request elements into a single string. The string is used as an input to the signature method. The signature base string includes the following components of the HTTP request:

The HTTP request method (GET or POST).

The authority, as declared by the HTTP host field in the request header.

The path and query components of the request resource URI.

The protocol parameters, excluding the oauth_signature.

The signature base string does not cover the entire HTTP request. Most important, it does not include the entity-body in most requests, nor does it include most HTTP entity-headers. It is important to note that the server cannot verify the authenticity of the excluded request components without using additional protections such as SSL/TLS or other methods.

oauth_timestamp

The timestamp value. Must be a positive integer. The timestamp is expressed in the number of seconds since January 1, 1970 00:00:00 GMT.

oauth_token

The temporary credentials identifier, if applicable. Returned in the response to Step 1; used in request and response for Step 2, and sent in the request message for Step 3.

oauth_token_secret

Secret value for the temporary credentials identifier, if applicable. If in use, sent whenever oauth_token is sent (see above).

oauth_verifier

A parameter verifying that the user has been authenticated and has granted the requested permission. Example: hfdp7dh39dks9884. Sent in the response to Step 2.