hoauth-0.1.7: A Haskell implementation of OAuth 1.0a protocol.

Safe HaskellNone

Network.Protocol.OAuth.Consumer

Description

A pure library that implements oauth authentication protocol as defined in http://oauth.net/core/1.0a.

Refer to http://oauth.net/ for more information about the oauth protocol.

Synopsis

Documentation

data Token Source

OAuth uses Tokens generated by the Service Provider instead of the User's credentials in Protected Resources requests.

Instances

data Consumer Source

The application which needs to authenticate using oauth.

Constructors

Unauthenticated String String

Creates a consumer with consumer_key and consumer_secret

Authenticated String String Token

A consumer with consumer_key, consumer_secret and a Token

request :: (Signer s, Show s) => Consumer -> s -> Request -> RequestSource

Sign a request for oauth request. Use this either to sign requests with a proper Access token or to use the oauth protocol to get a token from service provider.

The request you provide must contain oauth_nonce and oauth_timestamp parameters properly defined.

response :: Consumer -> ByteString -> Maybe ConsumerSource

Process the response of the service provider. The response should be an urlencoded string.

nonce_and_timestamp :: Request -> IO RequestSource

Generates the oauth_nonce and oauth_timestamp parameters.

plaintext_signature :: Consumer -> MethodSource

The PLAINTEXT signature for a given consumer

hmacsha1_signature :: Consumer -> MethodSource

The HMAC-SHA1 signature for a given consumer