Safe Haskell | None |
---|---|
Language | Haskell98 |
Deprecated: This module is deprecated; rewrite your code using MonadResource
This Module provides interface for the instance of MonadIO
instead of MonadIO
.
What this module do is just adding withManager
or runResourceT
.
Synopsis
- def :: Default a => a
- newtype Credential = Credential {
- unCredential :: [(ByteString, ByteString)]
- data AccessTokenRequest
- newtype OAuthException = OAuthException String
- data SignMethod
- data OAuthVersion
- data OAuth
- newOAuth :: OAuth
- defaultAccessTokenRequest :: OAuth -> Credential -> Manager -> AccessTokenRequest
- newCredential :: ByteString -> ByteString -> Credential
- emptyCredential :: Credential
- insert :: ByteString -> ByteString -> Credential -> Credential
- inserts :: [(ByteString, ByteString)] -> Credential -> Credential
- delete :: ByteString -> Credential -> Credential
- injectVerifier :: ByteString -> Credential -> Credential
- signOAuth :: MonadIO m => OAuth -> Credential -> Request -> m Request
- genSign :: MonadIO m => OAuth -> Credential -> Request -> m ByteString
- checkOAuth :: MonadIO m => OAuth -> Credential -> Request -> ExceptT OAuthException m Request
- authorizeUrl :: OAuth -> Credential -> String
- authorizeUrl' :: (OAuth -> Credential -> SimpleQuery) -> OAuth -> Credential -> String
- getAccessTokenWith :: MonadIO m => AccessTokenRequest -> m (Either (Response ByteString) Credential)
- addAuthBody :: a -> Credential -> Request -> Request
- paramEncode :: ByteString -> ByteString
- addScope :: ByteString -> Request -> Request
- addMaybeProxy :: Maybe Proxy -> Request -> Request
- getAccessToken :: MonadIO m => OAuth -> Credential -> m Credential
- getTemporaryCredential :: MonadIO m => OAuth -> m Credential
- getTemporaryCredentialWithScope :: MonadIO m => ByteString -> OAuth -> m Credential
- getTemporaryCredentialProxy :: MonadIO m => Maybe Proxy -> OAuth -> m Credential
- getTemporaryCredential' :: MonadIO m => (Request -> Request) -> OAuth -> m Credential
- getTokenCredential :: MonadIO m => OAuth -> Credential -> m Credential
- getAccessTokenProxy :: MonadIO m => Maybe Proxy -> OAuth -> Credential -> m Credential
- getTokenCredentialProxy :: MonadIO m => Maybe Proxy -> OAuth -> Credential -> m Credential
- getAccessToken' :: MonadIO m => (Request -> Request) -> OAuth -> Credential -> m Credential
Documentation
newtype Credential #
Data type for redential.
Credential | |
|
Instances
data AccessTokenRequest #
Data type for getAccessTokenWith method.
You can create values of this type using defaultAccessTokenRequest
.
Since 1.5.1
newtype OAuthException #
Instances
data SignMethod #
Data type for signature method.
Instances
Eq SignMethod # | |
Defined in Web.Authenticate.OAuth (==) :: SignMethod -> SignMethod -> Bool # (/=) :: SignMethod -> SignMethod -> Bool # | |
Data SignMethod # | |
Defined in Web.Authenticate.OAuth gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SignMethod -> c SignMethod # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SignMethod # toConstr :: SignMethod -> Constr # dataTypeOf :: SignMethod -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SignMethod) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SignMethod) # gmapT :: (forall b. Data b => b -> b) -> SignMethod -> SignMethod # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SignMethod -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SignMethod -> r # gmapQ :: (forall d. Data d => d -> u) -> SignMethod -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SignMethod -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SignMethod -> m SignMethod # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SignMethod -> m SignMethod # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SignMethod -> m SignMethod # | |
Read SignMethod # | |
Defined in Web.Authenticate.OAuth readsPrec :: Int -> ReadS SignMethod # readList :: ReadS [SignMethod] # readPrec :: ReadPrec SignMethod # readListPrec :: ReadPrec [SignMethod] # | |
Show SignMethod # | |
Defined in Web.Authenticate.OAuth showsPrec :: Int -> SignMethod -> ShowS # show :: SignMethod -> String # showList :: [SignMethod] -> ShowS # |
data OAuthVersion #
OAuth10 | OAuth protocol ver 1.0 (no oauth_verifier; differs from RFC 5849). |
OAuth10a | OAuth protocol ver 1.0a. This corresponds to community's 1.0a spec and RFC 5849. |
Instances
Data type for OAuth client (consumer).
The constructor for this data type is not exposed.
Instead, you should use the def
method or newOAuth
function to retrieve a default instance,
and then use the records below to make modifications.
This approach allows us to add configuration options without breaking backwards compatibility.
Instances
Eq OAuth # | |
Data OAuth # | |
Defined in Web.Authenticate.OAuth gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OAuth -> c OAuth # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OAuth # dataTypeOf :: OAuth -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OAuth) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OAuth) # gmapT :: (forall b. Data b => b -> b) -> OAuth -> OAuth # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OAuth -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OAuth -> r # gmapQ :: (forall d. Data d => d -> u) -> OAuth -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OAuth -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OAuth -> m OAuth # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OAuth -> m OAuth # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OAuth -> m OAuth # | |
Read OAuth # | |
Show OAuth # | |
Default OAuth # | |
Defined in Web.Authenticate.OAuth |
Default value for OAuth datatype. You must specify at least oauthServerName, URIs and Tokens.
defaultAccessTokenRequest :: OAuth -> Credential -> Manager -> AccessTokenRequest #
Create a value of type AccessTokenRequest
with default values filled in.
Note that this is a settings type. More information on usage can be found at: http://www.yesodweb.com/book/settings-types.
Since 1.5.1
:: ByteString | value for oauth_token |
-> ByteString | value for oauth_token_secret |
-> Credential |
Convenient function to create Credential
with OAuth Token and Token Secret.
emptyCredential :: Credential #
Empty credential.
:: ByteString | Parameter Name |
-> ByteString | Value |
-> Credential | Credential |
-> Credential | Result |
Insert an oauth parameter into given Credential
.
inserts :: [(ByteString, ByteString)] -> Credential -> Credential #
Convenient method for inserting multiple parameters into credential.
:: ByteString | Parameter name |
-> Credential | Credential |
-> Credential | Result |
Remove an oauth parameter for key from given Credential
.
injectVerifier :: ByteString -> Credential -> Credential #
Insert oauth-verifier
on a Credential
.
:: MonadIO m | |
=> OAuth | OAuth Application |
-> Credential | Credential |
-> Request | Original Request |
-> m Request | Signed OAuth Request |
Add OAuth headers & sign to Request
.
genSign :: MonadIO m => OAuth -> Credential -> Request -> m ByteString #
Generate OAuth signature. Used by signOAuth
.
checkOAuth :: MonadIO m => OAuth -> Credential -> Request -> ExceptT OAuthException m Request #
Test existing OAuth signature. Since 1.5.2
:: OAuth | OAuth Application |
-> Credential | Temporary Credential (Request Token & Secret) |
-> String | URL to authorize |
URL to obtain OAuth verifier.
:: (OAuth -> Credential -> SimpleQuery) | |
-> OAuth | OAuth Application |
-> Credential | Temporary Credential (Request Token & Secret) |
-> String | URL to authorize |
Convert OAuth and Credential to URL to authorize. This takes function to choice parameter to pass to the server other than oauth_callback or oauth_token.
:: MonadIO m | |
=> AccessTokenRequest | extensible parameters |
-> m (Either (Response ByteString) Credential) | Token Credential (Access Token & Secret) or the conduit response on failures |
addAuthBody :: a -> Credential -> Request -> Request #
Place the authentication information in a URL encoded body instead of the Authorization header.
Note that the first parameter is used for realm in addAuthHeader, and this function needs the same type. The parameter, however, is unused.
Since 1.5.1
paramEncode :: ByteString -> ByteString #
Encode a string using the percent encoding method for OAuth.
addScope :: ByteString -> Request -> Request #
:: MonadIO m | |
=> OAuth | OAuth Application |
-> Credential | Temporary Credential with oauth_verifier |
-> m Credential | Token Credential (Access Token & Secret) |
Get Access token.
:: MonadIO m | |
=> OAuth | OAuth Application |
-> m Credential | Temporary Credential (Request Token & Secret). |
Get temporary credential for requesting acces token.
getTemporaryCredentialWithScope #
:: MonadIO m | |
=> ByteString | Scope parameter string |
-> OAuth | OAuth Application |
-> m Credential | Temporay Credential (Request Token & Secret). |
Get temporary credential for requesting access token with Scope parameter.
:: MonadIO m | |
=> Maybe Proxy | Proxy |
-> OAuth | OAuth Application |
-> m Credential | Temporary Credential (Request Token & Secret). |
Get temporary credential for requesting access token via the proxy.
:: MonadIO m | |
=> (Request -> Request) | Request Hook |
-> OAuth | OAuth Application |
-> m Credential | Temporary Credential (Request Token & Secret). |
:: MonadIO m | |
=> OAuth | OAuth Application |
-> Credential | Temporary Credential with oauth_verifier |
-> m Credential | Token Credential (Access Token & Secret) |
Get Access token.
:: MonadIO m | |
=> Maybe Proxy | Proxy |
-> OAuth | OAuth Application |
-> Credential | Temporary Credential with oauth_verifier |
-> m Credential | Token Credential (Access Token & Secret) |
Get Access token via the proxy.
:: MonadIO m | |
=> Maybe Proxy | Proxy |
-> OAuth | OAuth Application |
-> Credential | Temporary Credential with oauth_verifier |
-> m Credential | Token Credential (Access Token & Secret) |
Get Access token via the proxy.
:: MonadIO m | |
=> (Request -> Request) | Request Hook |
-> OAuth | OAuth Application |
-> Credential | Temporary Credential with oauth_verifier |
-> m Credential | Token Credential (Access Token & Secret) |