HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

  • Packagehoauth2-2.15.2
  • Exports17
  • LanguageHaskell2010
  • LicenceMIT
  • SourceTokenRequest.hs

Token Request Errors

Instances3Eq, Show, FromJSON

Tokens

datadata TokenResponse

Constructors

Instances5Eq, Show, Binary, FromJSON, ToJSON

URL

Token management

valuefetchAccessTokenWithAuthMethod
  1. :: MonadIO m
  2. => ClientAuthenticationMethod
  3. -> Manager

    HTTP connection manager

  4. -> OAuth2

    OAuth Data

  5. -> ExchangeToken

    Authorization Code

  6. -> ExceptT TokenResponseError m TokenResponse

    Access Token

Exchange code for an Access Token

OAuth2 spec allows credential (client_id, client_secret) to be sent either in the header (a.k.a ClientSecretBasic). or as form/url params (a.k.a ClientSecretPost).

The OAuth provider can choose to implement only one, or both. Look for API document from the OAuth provider you're dealing with. If you`re uncertain, try fetchAccessToken which sends credential in authorization http header, which is common case.

valuerefreshAccessTokenWithAuthMethod
  1. :: MonadIO m
  2. => ClientAuthenticationMethod
  3. -> Manager

    HTTP connection manager.

  4. -> OAuth2

    OAuth context

  5. -> RefreshToken

    Refresh Token gained after authorization

  6. -> ExceptT TokenResponseError m TokenResponse

Fetch a new AccessToken using the Refresh Token.

OAuth2 spec allows credential ("client_id", "client_secret") to be sent either in the header (a.k.a ClientSecretBasic). or as form/url params (a.k.a ClientSecretPost).

The OAuth provider can choose to implement only one, or both. Look for API document from the OAuth provider you're dealing with. If you're uncertain, try refreshAccessToken which sends credential in authorization http header, which is common case.

Utilies