Added getTokenCredential = getAccessToken
This commit is contained in:
parent
4d87d3b2c6
commit
0b09a4f66b
@ -8,7 +8,8 @@ module Web.Authenticate.OAuth
|
||||
-- * Signature
|
||||
signOAuth,
|
||||
-- * Url & operation for authentication
|
||||
authorizeUrl, getAccessToken, getTemporaryCredential,
|
||||
authorizeUrl, getAccessToken, getTemporaryCredential,
|
||||
getTokenCredential,
|
||||
-- * Utility Methods
|
||||
paramEncode
|
||||
) where
|
||||
@ -97,7 +98,8 @@ authorizeUrl :: OAuth -- ^ OAuth Application
|
||||
authorizeUrl oa cr = qsUrl (oauthAuthorizeUri oa) [("oauth_token", BS.unpack $ token cr)]
|
||||
|
||||
-- | Get Access token.
|
||||
getAccessToken :: OAuth -- ^ OAuth Application
|
||||
getAccessToken, getTokenCredential
|
||||
:: OAuth -- ^ OAuth Application
|
||||
-> Credential -- ^ Temporary Credential with oauth_verifier
|
||||
-> IO Credential -- ^ Token Credential (Access Token & Secret)
|
||||
getAccessToken oa cr = do
|
||||
@ -106,6 +108,8 @@ getAccessToken oa cr = do
|
||||
let dic = parseQueryString . toStrict . responseBody $ rsp
|
||||
return $ Credential dic
|
||||
|
||||
getTokenCredential = getAccessToken
|
||||
|
||||
insertMap :: Eq a => a -> b -> [(a,b)] -> [(a,b)]
|
||||
insertMap key val = ((key,val):) . filter ((/=key).fst)
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name: authenticate
|
||||
version: 0.8.1
|
||||
version: 0.8.2
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
author: Michael Snoyman <michael@snoyman.com>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user