Class OAuth2::MACToken
In: lib/oauth2/mac_token.rb
Parent: AccessToken

Methods

Attributes

algorithm  [R] 
secret  [R] 

Public Class methods

Generates a MACToken from an AccessToken and secret

@param [AccessToken] token the OAuth2::Token instance @option [String] secret the secret key value @param [Hash] opts the options to create the Access Token with @see MACToken#initialize

Initalize a MACToken

@param [Client] client the OAuth2::Client instance @param [String] token the Access Token value @option [String] secret the secret key value @param [Hash] opts the options to create the Access Token with @option opts [String] :refresh_token (nil) the refresh_token value @option opts [FixNum, String] :expires_in (nil) the number of seconds in which the AccessToken will expire @option opts [FixNum, String] :expires_at (nil) the epoch time in seconds in which AccessToken will expire @option opts [FixNum, String] :algorithm (hmac-sha-256) the algorithm to use for the HMAC digest (one of ‘hmac-sha-256’, ‘hmac-sha-1’)

Public Instance methods

Set the HMAC algorithm

@param [String] alg the algorithm to use (one of ‘hmac-sha-1’, ‘hmac-sha-256’)

Generate the MAC header

@param [Symbol] verb the HTTP request method @param [String] url the HTTP URL path of the request

Get the headers hash (always an empty hash)

Make a request with the MAC Token

@param [Symbol] verb the HTTP request method @param [String] path the HTTP URL path of the request @param [Hash] opts the options to make the request with @see Client#request

Generate the Base64-encoded HMAC digest signature

@param [Fixnum] timestamp the timestamp of the request in seconds since epoch @param [String] nonce the MAC header nonce @param [Symbol] verb the HTTP request method @param [String] url the HTTP URL path of the request

[Validate]