hoauth2-1.7.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

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 # 
Generic OAuth2Token Source # 

Associated Types

type Rep OAuth2Token :: * -> * #

ToJSON OAuth2Token Source # 
FromJSON OAuth2Token Source #

Parse JSON data into OAuth2Token

type Rep OAuth2Token Source # 

data OAuth2Error a Source #

Instances

Eq a => Eq (OAuth2Error a) Source # 
Show a => Show (OAuth2Error a) Source # 
Generic (OAuth2Error a) Source # 

Associated Types

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

Methods

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

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

ToJSON err => ToJSON (OAuth2Error err) Source # 
FromJSON err => FromJSON (OAuth2Error err) Source # 
type Rep (OAuth2Error a) Source # 
type Rep (OAuth2Error a) = D1 * (MetaData "OAuth2Error" "Network.OAuth.OAuth2.Internal" "hoauth2-1.7.0-AY2UArvVGEn2VtpN3DOa42" False) (C1 * (MetaCons "OAuth2Error" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "error") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Either Text a))) ((:*:) * (S1 * (MetaSel (Just Symbol "errorDescription") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe Text))) (S1 * (MetaSel (Just Symbol "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.