yesod-auth-oauth2-0.6.1.6: OAuth 2.0 authentication plugins
Safe HaskellNone
LanguageHaskell2010

Yesod.Auth.OAuth2.Dispatch

Synopsis

Documentation

fetchAccessToken #

Arguments

:: 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

fetchAccessToken2 #

Arguments

:: 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 OAuth2Token and retrieve user credentials

dispatchAuthRequest Source #

Arguments

:: 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