Pulled some requests
This commit is contained in:
parent
e598a9fcbb
commit
e762a42f23
@ -9,12 +9,12 @@ module Web.Authenticate.OAuth
|
|||||||
signOAuth, genSign,
|
signOAuth, genSign,
|
||||||
-- * Url & operation for authentication
|
-- * Url & operation for authentication
|
||||||
authorizeUrl, getAccessToken, getTemporaryCredential,
|
authorizeUrl, getAccessToken, getTemporaryCredential,
|
||||||
getTokenCredential,
|
getTokenCredential, getTemporaryCredentialWithScope,
|
||||||
getAccessTokenProxy, getTemporaryCredentialProxy,
|
getAccessTokenProxy, getTemporaryCredentialProxy,
|
||||||
getTokenCredentialProxy,
|
getTokenCredentialProxy,
|
||||||
getAccessToken', getTemporaryCredential',
|
getAccessToken', getTemporaryCredential',
|
||||||
-- * Utility Methods
|
-- * Utility Methods
|
||||||
paramEncode
|
paramEncode, addScope, addMaybeProxy
|
||||||
) where
|
) where
|
||||||
import Network.HTTP.Enumerator
|
import Network.HTTP.Enumerator
|
||||||
import Web.Authenticate.Internal (qsUrl)
|
import Web.Authenticate.Internal (qsUrl)
|
||||||
@ -94,6 +94,16 @@ getTemporaryCredential :: OAuth -- ^ OAuth Application
|
|||||||
-> IO Credential -- ^ Temporary Credential (Request Token & Secret).
|
-> IO Credential -- ^ Temporary Credential (Request Token & Secret).
|
||||||
getTemporaryCredential = getTemporaryCredential' id
|
getTemporaryCredential = getTemporaryCredential' id
|
||||||
|
|
||||||
|
-- | Get temporary credential for requesting access token with Scope parameter.
|
||||||
|
getTemporaryCredentialWithScope :: BS.ByteString -- ^ Scope parameter string
|
||||||
|
-> OAuth -- ^ OAuth Application
|
||||||
|
-> IO Credential -- ^ Temporay Credential (Request Token & Secret).
|
||||||
|
getTemporaryCredentialWithScope = getTemporaryCredential' . addScope
|
||||||
|
|
||||||
|
addScope :: (MonadIO m) => BS.ByteString -> Request m -> Request m
|
||||||
|
addScope scope req | BS.null scope = req
|
||||||
|
| otherwise = urlEncodedBody [("scope", scope)] req
|
||||||
|
|
||||||
-- | Get temporary credential for requesting access token via the proxy.
|
-- | Get temporary credential for requesting access token via the proxy.
|
||||||
getTemporaryCredentialProxy :: Maybe Proxy -- ^ Proxy
|
getTemporaryCredentialProxy :: Maybe Proxy -- ^ Proxy
|
||||||
-> OAuth -- ^ OAuth Application
|
-> OAuth -- ^ OAuth Application
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user