abstract class SimpleOAuth::Consumer

Defined in:

simple_oauth/consumer.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(consumer_key : String, consumer_secret : String, callback_url : String) #

Creates a new Consumer with the specified credentials.


Class Method Detail

def self.authenticate_url(request_token : String) #

Returns the /authenticate URL with the OAuth Request Token passed as query string parameter. This is used in Step 2 of the 3-legged OAuth flow.


Instance Method Detail

def get_token : TokenPair #

Allows a Consumer application to obtain an OAuth Request Token to request user authorization.

Returns a TokenPair representing the OAuth Request Token data.


def upgrade_token(token : TokenPair, verifier : String) : TokenPair #

Converts the OAuth Request Token into an OAuth Access Token that can be used to call the API on the users' behalf. This method uses both the consumer secret and the resource owner secret to sign the request. OAuth providers like Twitter expect the token's oauth_token_secret to be an empty string.

Returns a TokenPair representing the OAuth Access Token data.