Class OAuth2::AccessToken
In: lib/oauth2/access_token.rb
Parent: Object

Methods

[]   delete   expired?   expires?   from_hash   from_kvform   get   new   post   put   refresh!   request  

Attributes

client  [R] 
expires_at  [R] 
expires_in  [R] 
options  [RW] 
params  [R] 
refresh_token  [R] 
token  [R] 

Public Class methods

Initializes an AccessToken from a Hash

@param [Client] the OAuth2::Client instance @param [Hash] a hash of AccessToken property values @return [AccessToken] the initalized AccessToken

Initializes an AccessToken from a key/value application/x-www-form-urlencoded string

@param [Client] client the OAuth2::Client instance @param [String] kvform the application/x-www-form-urlencoded string @return [AccessToken] the initalized AccessToken

Initalize an AccessToken

@param [Client] client the OAuth2::Client instance @param [String] token the Access Token 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 [Symbol] :mode (:header) the transmission mode of the Access Token parameter value

   one of :header, :body or :query

@option opts [String] :header_format (‘Bearer %s’) the string format to use for the Authorization header @option opts [String] :param_name (‘bearer_token’) the parameter name to use for transmission of the

   Access Token value in :body or :query transmission mode

Public Instance methods

Indexer to additional params present in token response

@param [String] key entry key to Hash

Make a DELETE request with the Access Token

@see AccessToken#request

Whether or not the token is expired

@return [Boolean]

Whether or not the token expires

@return [Boolean]

Make a GET request with the Access Token

@see AccessToken#request

Make a POST request with the Access Token

@see AccessToken#request

Make a PUT request with the Access Token

@see AccessToken#request

Refreshes the current Access Token

@return [AccessToken] a new AccessToken @note options should be carried over to the new AccessToken

Make a request with the Access 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

[Validate]