hoauth2-1.9.0: Haskell OAuth2 authentication client

Safe HaskellNone
LanguageHaskell2010

Network.OAuth.OAuth2.Internal

Contents

Description

A simple OAuth2 Haskell binding. (This is supposed to be independent of the http client used.)

Synopsis

Data Types

data OAuth2 Source #

Query Parameter Representation

Instances
Eq OAuth2 Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

Methods

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

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

Show OAuth2 Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

data OAuth2Token Source #

The gained Access Token. Use Data.Aeson.decode to decode string to AccessToken. The refreshToken is special in some cases, e.g. https://developers.google.com/accounts/docs/OAuth2

Instances
Show 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 #

ToJSON OAuth2Token Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

FromJSON OAuth2Token Source #

Parse JSON data into OAuth2Token

Instance details

Defined in Network.OAuth.OAuth2.Internal

Binary OAuth2Token Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

type Rep OAuth2Token Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

data OAuth2Error a Source #

Instances
Eq a => Eq (OAuth2Error a) Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

Show a => Show (OAuth2Error a) Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

Generic (OAuth2Error a) Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

Associated Types

type Rep (OAuth2Error a) :: Type -> Type #

Methods

from :: OAuth2Error a -> Rep (OAuth2Error a) x #

to :: Rep (OAuth2Error a) x -> OAuth2Error a #

ToJSON err => ToJSON (OAuth2Error err) Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

FromJSON err => FromJSON (OAuth2Error err) Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

type Rep (OAuth2Error a) Source # 
Instance details

Defined in Network.OAuth.OAuth2.Internal

type Rep (OAuth2Error a) = D1 (MetaData "OAuth2Error" "Network.OAuth.OAuth2.Internal" "hoauth2-1.9.0-2d8LWznYoULD03ddmwMyhZ" False) (C1 (MetaCons "OAuth2Error" PrefixI True) (S1 (MetaSel (Just "error") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Either Text a)) :*: (S1 (MetaSel (Just "errorDescription") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "errorUri") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (URIRef Absolute))))))

Types Synonym

type OAuth2Result err a = Either (OAuth2Error err) a Source #

Is either Left containing an error or Right containg a result

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

type synonym of post body content

URLs

authorizationUrl :: OAuth2 -> URI Source #

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

accessTokenUrl Source #

Arguments

:: OAuth2 
-> ExchangeToken

access code gained via authorization URL

-> (URI, PostBody)

access token request URL plus the request body.

Prepare the URL and the request body query for fetching an access token.

accessTokenUrl' Source #

Arguments

:: OAuth2 
-> ExchangeToken

access code gained via authorization URL

-> Maybe Text

Grant Type

-> (URI, PostBody)

access token request URL plus the request body.

Prepare the URL and the request body query for fetching an access token, with optional grant type.

refreshAccessTokenUrl Source #

Arguments

:: OAuth2 
-> RefreshToken

refresh token gained via authorization URL

-> (URI, PostBody)

refresh token request URL plus the request body.

Using a Refresh Token. Obtain a new access token by sending a refresh token to the Authorization server.

appendAccessToken Source #

Arguments

:: URIRef a

Base URI

-> AccessToken

Authorized Access Token

-> URIRef a

Combined Result

For GET method API.

accessTokenToParam :: AccessToken -> [(ByteString, ByteString)] Source #

Create QueryParams with given access token value.