hoauth2-2.8.0: Haskell OAuth2 authentication client

Safe Haskell | Safe-Inferred
Language | Haskell2010

Network.OAuth.OAuth2.AuthorizationRequest

Contents

- Errors
- URLs

Description

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

Synopsis

- data Errors
  - = InvalidRequest
  - | UnauthorizedClient
  - | AccessDenied
  - | UnsupportedResponseType
  - | InvalidScope
  - | ServerError
  - | TemporarilyUnavailable
- authorizationUrl :: OAuth2 -> URI
- authorizationUrlWithParams :: QueryParams -> OAuth2 -> URI

# Errors

data Errors 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

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

#### Instances

Instances details

FromJSON Errors Source # |
Instance details Defined in Network.OAuth.OAuth2.AuthorizationRequest Methods parseJSON :: Value -> Parser Errors Source # parseJSONList :: Value -> Parser [Errors] Source #
Generic Errors Source # |
Instance details Defined in Network.OAuth.OAuth2.AuthorizationRequest Associated Types type Rep Errors :: Type -> Type Source # Methods from :: Errors -> Rep Errors x Source # to :: Rep Errors x -> Errors Source #
Show Errors Source # |
Instance details Defined in Network.OAuth.OAuth2.AuthorizationRequest Methods showsPrec :: Int -> Errors -> ShowS Source # show :: Errors -> String Source # showList :: [Errors] -> ShowS Source #
Eq Errors Source # |
Instance details Defined in Network.OAuth.OAuth2.AuthorizationRequest Methods (==) :: Errors -> Errors -> Bool Source # (/=) :: Errors -> Errors -> Bool Source #
type Rep Errors Source # |

Instance details

Defined in Network.OAuth.OAuth2.AuthorizationRequest

type Rep Errors = D1 ('MetaData "Errors" "Network.OAuth.OAuth2.AuthorizationRequest" "hoauth2-2.8.0-BZtVYBecI8q9t55UsNfiTk" 'False) ((C1 ('MetaCons "InvalidRequest" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UnauthorizedClient" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AccessDenied" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "UnsupportedResponseType" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InvalidScope" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ServerError" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TemporarilyUnavailable" 'PrefixI 'False) (U1 :: Type -> Type))))

# 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