Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type FetchToken = Manager -> OAuth2 -> ExchangeToken -> IO (OAuth2Result Errors OAuth2Token)
- fetchAccessToken :: Manager -> OAuth2 -> ExchangeToken -> IO (OAuth2Result Errors OAuth2Token)
- fetchAccessToken2 :: Manager -> OAuth2 -> ExchangeToken -> IO (OAuth2Result Errors OAuth2Token)
- type FetchCreds m = Manager -> OAuth2Token -> IO (Creds m)
- dispatchAuthRequest :: Text -> OAuth2 -> FetchToken -> FetchCreds m -> Text -> [Text] -> AuthHandler m TypedContent
Documentation
type FetchToken = Manager -> OAuth2 -> ExchangeToken -> IO (OAuth2Result Errors OAuth2Token) Source #
How to fetch an OAuth2Token
This will be fetchAccessToken
or fetchAccessToken2
:: Manager | HTTP connection manager |
-> OAuth2 | OAuth Data |
-> ExchangeToken | OAuth2 Code |
-> IO (OAuth2Result Errors OAuth2Token) | Access Token |
Fetch OAuth2 Token with authenticate in request header.
OAuth2 spec allows client_id
and client_secret
to
either be sent in the header (as basic authentication)
OR as form/url params.
The OAuth server can choose to implement only one, or both.
Unfortunately, there is no way for the OAuth client (i.e. this library) to
know which method to use. Please take a look at the documentation of the
service that you are integrating with and either use fetchAccessToken
or fetchAccessToken2
:: Manager | HTTP connection manager |
-> OAuth2 | OAuth Data |
-> ExchangeToken | OAuth 2 Tokens |
-> IO (OAuth2Result Errors OAuth2Token) | Access Token |
Please read the docs of fetchAccessToken
.
type FetchCreds m = Manager -> OAuth2Token -> IO (Creds m) Source #
How to take an
and retrieve user credentialsOAuth2Token
:: Text | Name |
-> OAuth2 | Service details |
-> FetchToken | How to get a token |
-> FetchCreds m | How to get credentials |
-> Text | Method |
-> [Text] | Path pieces |
-> AuthHandler m TypedContent |
Dispatch the various OAuth2 handshake routes