hoauth2-1.9.0: Haskell OAuth2 authentication client

Safe HaskellNone
LanguageHaskell2010

Network.OAuth.OAuth2.HttpClient

Contents

Description

A simple http client to request OAuth2 tokens and several utils.

Synopsis

Token management

fetchAccessToken Source #

Arguments

:: Manager

HTTP connection manager

-> OAuth2

OAuth Data

-> ExchangeToken

OAuth 2 Tokens

-> IO (OAuth2Result Errors OAuth2Token)

Access Token

Request OAuth2 Token method: POST authenticate in header

fetchAccessToken2 Source #

Arguments

:: Manager

HTTP connection manager

-> OAuth2

OAuth Data

-> ExchangeToken

OAuth 2 Tokens

-> IO (OAuth2Result Errors OAuth2Token)

Access Token

Request OAuth2 Token method: POST authenticate in both header and body

refreshAccessToken Source #

Arguments

:: Manager

HTTP connection manager.

-> OAuth2

OAuth context

-> RefreshToken

refresh token gained after authorization

-> IO (OAuth2Result Errors OAuth2Token) 

Request a new AccessToken with the Refresh Token.

AUTH requests

authGetJSON Source #

Arguments

:: FromJSON b 
=> Manager

HTTP connection manager.

-> AccessToken 
-> URI 
-> IO (Either ByteString b)

Response as JSON

Conduct an authorized GET request and return response as JSON.

authGetBS Source #

Arguments

:: Manager

HTTP connection manager.

-> AccessToken 
-> URI 
-> IO (Either ByteString ByteString)

Response as ByteString

Conduct an authorized GET request.

authGetBS2 Source #

Arguments

:: Manager

HTTP connection manager.

-> AccessToken 
-> URI 
-> IO (Either ByteString ByteString)

Response as ByteString

same to authGetBS but set access token to query parameter rather than header

authPostJSON Source #

Arguments

:: FromJSON b 
=> Manager

HTTP connection manager.

-> AccessToken 
-> URI 
-> PostBody 
-> IO (Either ByteString b)

Response as JSON

Conduct POST request and return response as JSON.

authPostBS Source #

Arguments

:: Manager

HTTP connection manager.

-> AccessToken 
-> URI 
-> PostBody 
-> IO (Either ByteString ByteString)

Response as ByteString

Conduct POST request.

authPostBS2 Source #

Arguments

:: Manager

HTTP connection manager.

-> AccessToken 
-> URI 
-> PostBody 
-> IO (Either ByteString ByteString)

Response as ByteString

Conduct POST request with access token in the request body rather header

authPostBS3 Source #

Arguments

:: Manager

HTTP connection manager.

-> AccessToken 
-> URI 
-> IO (Either ByteString ByteString)

Response as ByteString

Conduct POST request with access token in the header and null in body

authRequest Source #

Arguments

:: Request

Request to perform

-> (Request -> Request)

Modify request before sending

-> Manager

HTTP connection manager.

-> IO (Either ByteString ByteString) 

Send an HTTP request including the Authorization header with the specified access token.