Safe Haskell | None |
---|
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.
- data Token
- data Consumer
- request :: (Signer s, Show s) => Consumer -> s -> Request -> Request
- response :: Consumer -> ByteString -> Maybe Consumer
- nonce_and_timestamp :: Request -> IO Request
- oauth_token :: Token -> String
- oauth_token_secret :: Token -> String
- oauth_extra :: Token -> [Parameter]
- plaintext_signature :: Consumer -> Method
- hmacsha1_signature :: Consumer -> Method
Documentation
OAuth uses Tokens generated by the Service Provider instead of the User's credentials in Protected Resources requests.
The application which needs to authenticate using oauth.
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 |
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.
oauth_token :: Token -> StringSource
oauth_extra :: Token -> [Parameter]Source
plaintext_signature :: Consumer -> MethodSource
The PLAINTEXT signature for a given consumer
hmacsha1_signature :: Consumer -> MethodSource
The HMAC-SHA1 signature for a given consumer