Module Twitter::REST::OAuth
In: lib/twitter/rest/oauth.rb

Methods

Included Modules

Twitter::REST::Utils

Public Instance methods

bearer_token(options = {})

Alias for token

Allows a registered application to revoke an issued OAuth 2 Bearer Token by presenting its client credentials.

@see dev.twitter.com/rest/reference/post/oauth2/invalidate_token @rate_limited No @authentication Required @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @param access_token [String, Twitter::Token] The bearer token to revoke. @param options [Hash] A customizable set of options. @return [Twitter::Token] The invalidated token. token_type should be nil.

Allows a registered application to revoke an issued OAuth 2 Bearer Token by presenting its client credentials.

@see dev.twitter.com/rest/reference/post/oauth2/invalidate_token @rate_limited No @authentication Required @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [String] The token string.

Allows a registered application to obtain an OAuth 2 Bearer Token, which can be used to make API requests on an application‘s own behalf, without a user context.

Only one bearer token may exist outstanding for an application, and repeated requests to this method will yield the same already-existent token until it has been invalidated.

@see dev.twitter.com/rest/reference/post/oauth2/token @rate_limited No @authentication Required @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Token] The Bearer Token. token_type should be ‘bearer’. @param options [Hash] A customizable set of options. @example Generate a Bearer Token

  client = Twitter::REST::Client.new(:consumer_key => "abc", :consumer_secret => 'def')
  bearer_token = client.token

[Validate]