hoauth2-2.10.0: Haskell OAuth2 authentication client

Safe Haskell | Safe-Inferred
Language | Haskell2010

Network.OAuth2.Experiment.Flows.TokenRequest

Synopsis

- class HasTokenRequestClientAuthenticationMethod a where
  - getClientAuthenticationMethod :: a -> ClientAuthenticationMethod
- data NoNeedExchangeToken = NoNeedExchangeToken
- class (HasOAuth2Key a, HasTokenRequestClientAuthenticationMethod a) => HasTokenRequest a where
  - data TokenRequest a
  - type ExchangeTokenInfo a
  - mkTokenRequestParam :: a -> ExchangeTokenInfo a -> TokenRequest a
- conduitTokenRequest :: (HasTokenRequest a, ToQueryParam (TokenRequest a), MonadIO m) => IdpApplication i a -> Manager -> ExchangeTokenInfo a -> ExceptT TokenResponseError m OAuth2Token
- conduitPkceTokenRequest :: (HasTokenRequest a, ToQueryParam (TokenRequest a), MonadIO m) => IdpApplication i a -> Manager -> (ExchangeTokenInfo a, CodeVerifier) -> ExceptT TokenResponseError m OAuth2Token

# Documentation

class HasTokenRequestClientAuthenticationMethod a where Source #

Methods

getClientAuthenticationMethod :: a -> ClientAuthenticationMethod Source #

#### Instances

Instances details

HasTokenRequestClientAuthenticationMethod AuthorizationCodeApplication Source # |
Instance details Defined in Network.OAuth2.Experiment.Grants.AuthorizationCode Methods getClientAuthenticationMethod :: AuthorizationCodeApplication -> ClientAuthenticationMethod Source #
HasTokenRequestClientAuthenticationMethod ClientCredentialsApplication Source # |
Instance details Defined in Network.OAuth2.Experiment.Grants.ClientCredentials Methods getClientAuthenticationMethod :: ClientCredentialsApplication -> ClientAuthenticationMethod Source #
HasTokenRequestClientAuthenticationMethod DeviceAuthorizationApplication Source # |
Instance details Defined in Network.OAuth2.Experiment.Grants.DeviceAuthorization Methods getClientAuthenticationMethod :: DeviceAuthorizationApplication -> ClientAuthenticationMethod Source #
HasTokenRequestClientAuthenticationMethod JwtBearerApplication Source # |
Instance details Defined in Network.OAuth2.Experiment.Grants.JwtBearer Methods getClientAuthenticationMethod :: JwtBearerApplication -> ClientAuthenticationMethod Source #
HasTokenRequestClientAuthenticationMethod ResourceOwnerPasswordApplication Source # |
Instance details Defined in Network.OAuth2.Experiment.Grants.ResourceOwnerPassword Methods getClientAuthenticationMethod :: ResourceOwnerPasswordApplication -> ClientAuthenticationMethod Source #

data NoNeedExchangeToken Source #

Only Authorization Code Grant involves a Exchange Token (Authorization Code). ResourceOwnerPassword and Client Credentials make token request directly.

Constructors

NoNeedExchangeToken |

class (HasOAuth2Key a, HasTokenRequestClientAuthenticationMethod a) => HasTokenRequest a where Source #

Associated Types

data TokenRequest a Source #

type ExchangeTokenInfo a Source #

Methods

mkTokenRequestParam :: a -> ExchangeTokenInfo a -> TokenRequest a Source #

Only 'AuthorizationCode flow (but not resource owner password nor client credentials) will use `ExchangeToken` in the token request create type family to be explicit on it. with 'type instance WithExchangeToken a b = b' implies no exchange token v.s. 'type instance WithExchangeToken a b = ExchangeToken -> b' implies needing an exchange token type WithExchangeToken a b

#### Instances

Instances details

HasTokenRequest AuthorizationCodeApplication Source # | https://www.rfc-editor.org/rfc/rfc6749#section-4.1.3
Instance details Defined in Network.OAuth2.Experiment.Grants.AuthorizationCode Associated Types data TokenRequest AuthorizationCodeApplication Source # type ExchangeTokenInfo AuthorizationCodeApplication Source # Methods mkTokenRequestParam :: AuthorizationCodeApplication -> ExchangeTokenInfo AuthorizationCodeApplication -> TokenRequest AuthorizationCodeApplication Source #
HasTokenRequest ClientCredentialsApplication Source # | https://www.rfc-editor.org/rfc/rfc6749#section-4.4.2
Instance details Defined in Network.OAuth2.Experiment.Grants.ClientCredentials Associated Types data TokenRequest ClientCredentialsApplication Source # type ExchangeTokenInfo ClientCredentialsApplication Source # Methods mkTokenRequestParam :: ClientCredentialsApplication -> ExchangeTokenInfo ClientCredentialsApplication -> TokenRequest ClientCredentialsApplication Source #
HasTokenRequest DeviceAuthorizationApplication Source # | https://www.rfc-editor.org/rfc/rfc8628#section-3.4
Instance details Defined in Network.OAuth2.Experiment.Grants.DeviceAuthorization Associated Types data TokenRequest DeviceAuthorizationApplication Source # type ExchangeTokenInfo DeviceAuthorizationApplication Source # Methods mkTokenRequestParam :: DeviceAuthorizationApplication -> ExchangeTokenInfo DeviceAuthorizationApplication -> TokenRequest DeviceAuthorizationApplication Source #
HasTokenRequest JwtBearerApplication Source # |
Instance details Defined in Network.OAuth2.Experiment.Grants.JwtBearer Associated Types data TokenRequest JwtBearerApplication Source # type ExchangeTokenInfo JwtBearerApplication Source # Methods mkTokenRequestParam :: JwtBearerApplication -> ExchangeTokenInfo JwtBearerApplication -> TokenRequest JwtBearerApplication Source #
HasTokenRequest ResourceOwnerPasswordApplication Source # | https://www.rfc-editor.org/rfc/rfc6749#section-4.3.2
Instance details Defined in Network.OAuth2.Experiment.Grants.ResourceOwnerPassword Associated Types data TokenRequest ResourceOwnerPasswordApplication Source # type ExchangeTokenInfo ResourceOwnerPasswordApplication Source # Methods mkTokenRequestParam :: ResourceOwnerPasswordApplication -> ExchangeTokenInfo ResourceOwnerPasswordApplication -> TokenRequest ResourceOwnerPasswordApplication Source #

conduitTokenRequest :: (HasTokenRequest a, ToQueryParam (TokenRequest a), MonadIO m) => IdpApplication i a -> Manager -> ExchangeTokenInfo a -> ExceptT TokenResponseError m OAuth2Token Source #

Make Token Request https://www.rfc-editor.org/rfc/rfc6749#section-4.1.3

conduitPkceTokenRequest :: (HasTokenRequest a, ToQueryParam (TokenRequest a), MonadIO m) => IdpApplication i a -> Manager -> (ExchangeTokenInfo a, CodeVerifier) -> ExceptT TokenResponseError m OAuth2Token Source #

Make Token Request (PKCE) https://datatracker.ietf.org/doc/html/rfc7636#section-4.5