hoauth2-2.12.0: Haskell OAuth2 authentication client
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.OAuth.OAuth2

Description

A lightweight oauth2 Haskell binding. See Readme for more details

Synopsis

OAuth2 Configuration

data OAuth2 Source #

Query Parameter Representation

Instances

Instances details
Show OAuth2 Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

Default OAuth2 Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

Methods

def :: OAuth2 #

Eq OAuth2 Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

Methods

(==) :: OAuth2 -> OAuth2 -> Bool #

(/=) :: OAuth2 -> OAuth2 -> Bool #

Tokens

newtype IdToken Source #

Constructors

IdToken 

Fields

data OAuth2Token Source #

Constructors

OAuth2Token 

Fields

Instances

Instances details
FromJSON OAuth2Token Source #

Parse JSON data into OAuth2Token

Instance details

Defined in Network.OAuth.OAuth2.Internal

ToJSON OAuth2Token Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

Generic OAuth2Token Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

Associated Types

type Rep OAuth2Token :: Type -> Type #

Show OAuth2Token Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

Binary OAuth2Token Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

Eq OAuth2Token Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

type Rep OAuth2Token Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

type Rep OAuth2Token = D1 ('MetaData "OAuth2Token" "Network.OAuth.OAuth2.Internal" "hoauth2-2.12.0-5GCoMMrm3UmIiLmRb8Lhoe" 'False) (C1 ('MetaCons "OAuth2Token" 'PrefixI 'True) ((S1 ('MetaSel ('Just "accessToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AccessToken) :*: S1 ('MetaSel ('Just "refreshToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe RefreshToken))) :*: (S1 ('MetaSel ('Just "expiresIn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: (S1 ('MetaSel ('Just "tokenType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "idToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe IdToken))))))

Client Authentication methods

data ClientAuthenticationMethod Source #

https://www.rfc-editor.org/rfc/rfc6749#section-2.3 According to spec:

The client MUST NOT use more than one authentication method in each request.

Which means use Authorization header or Post body.

However, I found I have to include authentication in the header all the time in real world.

In other words, ClientSecretBasic is always assured. ClientSecretPost is optional.

Maybe consider an alternative implementation that boolean kind of data type is good enough.

Utilies for Request and URI

type PostBody = [(ByteString, ByteString)] Source #

Type synonym of post body content

type QueryParams = [(ByteString, ByteString)] Source #

Type sysnonym of request query params

Authorization Requset

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

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

Since: 2.6.0

Token Request

OAuth'ed http client utilities