hoauth2-2.10.0: Haskell OAuth2 authentication client

Safe Haskell | Safe-Inferred
Language | Haskell2010

Network.OAuth.OAuth2.AuthorizationRequest

Contents

- Authorization Request Errors
- URLs

Description

Bindings Authorization part of The OAuth 2.0 Authorization Framework RFC6749 https://www.rfc-editor.org/rfc/rfc6749

Synopsis

- data AuthorizationResponseError = AuthorizationResponseError {
  - authorizationResponseError :: AuthorizationResponseErrorCode
  - authorizationResponseErrorDescription :: Maybe Text
  - authorizationResponseErrorUri :: Maybe (URIRef Absolute)
  }
- data AuthorizationResponseErrorCode
  - = InvalidRequest
  - | UnauthorizedClient
  - | AccessDenied
  - | UnsupportedResponseType
  - | InvalidScope
  - | ServerError
  - | TemporarilyUnavailable
  - | UnknownErrorCode Text
- authorizationUrl :: OAuth2 -> URI
- authorizationUrlWithParams :: QueryParams -> OAuth2 -> URI

# Authorization Request Errors

data AuthorizationResponseError Source #

Authorization Code Grant Error Responses https://tools.ietf.org/html/rfc6749#section-4.1.2.1

I found hard time to figure a way to test the authorization error flow When anything wrong in `/authorize` request, it will stuck at the Provider page hence no way for this library to parse error response. In other words, `/authorize` ends up with 4xx or 5xx. Revisit this whenever find a case OAuth2 provider redirects back to Relying party with errors.

Constructors

AuthorizationResponseError |

Fields

- authorizationResponseError :: AuthorizationResponseErrorCode
- authorizationResponseErrorDescription :: Maybe Text
- authorizationResponseErrorUri :: Maybe (URIRef Absolute)

#### Instances

Instances details

FromJSON AuthorizationResponseError Source # |
Instance details Defined in Network.OAuth.OAuth2.AuthorizationRequest Methods parseJSON :: Value -> Parser AuthorizationResponseError Source # parseJSONList :: Value -> Parser [AuthorizationResponseError] Source #
Show AuthorizationResponseError Source # |
Instance details Defined in Network.OAuth.OAuth2.AuthorizationRequest Methods showsPrec :: Int -> AuthorizationResponseError -> ShowS Source # show :: AuthorizationResponseError -> String Source # showList :: [AuthorizationResponseError] -> ShowS Source #
Eq AuthorizationResponseError Source # |
Instance details Defined in Network.OAuth.OAuth2.AuthorizationRequest Methods (==) :: AuthorizationResponseError -> AuthorizationResponseError -> Bool Source # (/=) :: AuthorizationResponseError -> AuthorizationResponseError -> Bool Source #

data AuthorizationResponseErrorCode Source #

Constructors

InvalidRequest |
UnauthorizedClient |
AccessDenied |
UnsupportedResponseType |
InvalidScope |
ServerError |
TemporarilyUnavailable |
UnknownErrorCode Text |

#### Instances

Instances details

FromJSON AuthorizationResponseErrorCode Source # |
Instance details Defined in Network.OAuth.OAuth2.AuthorizationRequest Methods parseJSON :: Value -> Parser AuthorizationResponseErrorCode Source # parseJSONList :: Value -> Parser [AuthorizationResponseErrorCode] Source #
Show AuthorizationResponseErrorCode Source # |
Instance details Defined in Network.OAuth.OAuth2.AuthorizationRequest Methods showsPrec :: Int -> AuthorizationResponseErrorCode -> ShowS Source # show :: AuthorizationResponseErrorCode -> String Source # showList :: [AuthorizationResponseErrorCode] -> ShowS Source #
Eq AuthorizationResponseErrorCode Source # |
Instance details Defined in Network.OAuth.OAuth2.AuthorizationRequest Methods (==) :: AuthorizationResponseErrorCode -> AuthorizationResponseErrorCode -> Bool Source # (/=) :: AuthorizationResponseErrorCode -> AuthorizationResponseErrorCode -> Bool Source #

# URLs

authorizationUrl :: OAuth2 -> URI Source #

See `authorizationUrlWithParams`

authorizationUrlWithParams :: QueryParams -> OAuth2 -> URI Source #

Prepare the authorization URL. Redirect to this URL asking for user interactive authentication.

Since: 2.6.0