hoauth2-2.14.3: Haskell OAuth2 authentication client

Safe Haskell | None
Language | Haskell2010

Network.OAuth.OAuth2.HttpClient

Contents

- AUTH requests
- Types

Description

Bindings for The OAuth 2.0 Authorization Framework: Bearer Token Usage RFC6750 https://www.rfc-editor.org/rfc/rfc6750

Synopsis

- authGetJSON :: forall (m :: Type -> Type) a. (MonadIO m, FromJSON a) => Manager -> AccessToken -> URI -> ExceptT ByteString m a
- authGetBS :: forall (m :: Type -> Type). MonadIO m => Manager -> AccessToken -> URI -> ExceptT ByteString m ByteString
- authGetBS2 :: forall (m :: Type -> Type). MonadIO m => Manager -> AccessToken -> URI -> ExceptT ByteString m ByteString
- authGetJSONWithAuthMethod :: forall (m :: Type -> Type) a. (MonadIO m, FromJSON a) => APIAuthenticationMethod -> Manager -> AccessToken -> URI -> ExceptT ByteString m a
- authGetJSONInternal :: forall (m :: Type -> Type) a. (MonadIO m, FromJSON a) => APIAuthenticationMethod -> Manager -> AccessToken -> URI -> ExceptT ByteString m a
- authGetBSWithAuthMethod :: forall (m :: Type -> Type). MonadIO m => APIAuthenticationMethod -> Manager -> AccessToken -> URI -> ExceptT ByteString m ByteString
- authGetBSInternal :: forall (m :: Type -> Type). MonadIO m => APIAuthenticationMethod -> Manager -> AccessToken -> URI -> ExceptT ByteString m ByteString
- authPostJSON :: forall (m :: Type -> Type) a. (MonadIO m, FromJSON a) => Manager -> AccessToken -> URI -> PostBody -> ExceptT ByteString m a
- authPostBS :: forall (m :: Type -> Type). MonadIO m => Manager -> AccessToken -> URI -> PostBody -> ExceptT ByteString m ByteString
- authPostBS2 :: forall (m :: Type -> Type). MonadIO m => Manager -> AccessToken -> URI -> PostBody -> ExceptT ByteString m ByteString
- authPostBS3 :: forall (m :: Type -> Type). MonadIO m => Manager -> AccessToken -> URI -> PostBody -> ExceptT ByteString m ByteString
- authPostJSONWithAuthMethod :: forall (m :: Type -> Type) a. (MonadIO m, FromJSON a) => APIAuthenticationMethod -> Manager -> AccessToken -> URI -> PostBody -> ExceptT ByteString m a
- authPostJSONInternal :: forall (m :: Type -> Type) a. (MonadIO m, FromJSON a) => APIAuthenticationMethod -> Manager -> AccessToken -> URI -> PostBody -> ExceptT ByteString m a
- authPostBSWithAuthMethod :: forall (m :: Type -> Type). MonadIO m => APIAuthenticationMethod -> Manager -> AccessToken -> URI -> PostBody -> ExceptT ByteString m ByteString
- authPostBSInternal :: forall (m :: Type -> Type). MonadIO m => APIAuthenticationMethod -> Manager -> AccessToken -> URI -> PostBody -> ExceptT ByteString m ByteString
- data APIAuthenticationMethod
  - = AuthInRequestHeader
  - | AuthInRequestBody
  - | AuthInRequestQuery

# AUTH requests

authGetJSON Source #

Arguments

:: forall (m :: Type -> Type) a. (MonadIO m, FromJSON a) |
=> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> ExceptT ByteString m a | Response as JSON

Conduct an authorized GET request and return response as JSON. Inject Access Token to Authorization Header.

authGetBS Source #

Arguments

:: forall (m :: Type -> Type). MonadIO m |
=> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> ExceptT ByteString m ByteString | Response as ByteString

Conduct an authorized GET request. Inject Access Token to Authorization Header.

authGetBS2 Source #

Arguments

:: forall (m :: Type -> Type). MonadIO m |
=> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> ExceptT ByteString m ByteString | Response as ByteString

Deprecated: use authGetBSWithAuthMethod

Same to `authGetBS` but set access token to query parameter rather than header

authGetJSONWithAuthMethod Source #

Arguments

:: forall (m :: Type -> Type) a. (MonadIO m, FromJSON a) |
=> APIAuthenticationMethod |
-> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> ExceptT ByteString m a | Response as JSON

Conduct an authorized GET request and return response as JSON. Allow to specify how to append AccessToken.

Since: 2.6.0

authGetJSONInternal Source #

Arguments

:: forall (m :: Type -> Type) a. (MonadIO m, FromJSON a) |
=> APIAuthenticationMethod |
-> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> ExceptT ByteString m a | Response as JSON

Deprecated: use authGetJSONWithAuthMethod

Deprecated. Use `authGetJSONWithAuthMethod` instead.

authGetBSWithAuthMethod Source #

Arguments

:: forall (m :: Type -> Type). MonadIO m |
=> APIAuthenticationMethod | Specify the way that how to append the `AccessToken` in the request
-> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> ExceptT ByteString m ByteString | Response as ByteString

Conduct an authorized GET request and return response as ByteString. Allow to specify how to append AccessToken.

Since: 2.6.0

authGetBSInternal Source #

Arguments

:: forall (m :: Type -> Type). MonadIO m |
=> APIAuthenticationMethod |
-> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> ExceptT ByteString m ByteString | Response as ByteString

Deprecated: use authGetBSWithAuthMethod

authPostJSON Source #

Arguments

:: forall (m :: Type -> Type) a. (MonadIO m, FromJSON a) |
=> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> PostBody |
-> ExceptT ByteString m a | Response as JSON

Conduct POST request and return response as JSON. Inject Access Token to Authorization Header.

authPostBS Source #

Arguments

:: forall (m :: Type -> Type). MonadIO m |
=> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> PostBody |
-> ExceptT ByteString m ByteString | Response as ByteString

Conduct POST request. Inject Access Token to http header (Authorization)

authPostBS2 Source #

Arguments

:: forall (m :: Type -> Type). MonadIO m |
=> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> PostBody |
-> ExceptT ByteString m ByteString | Response as ByteString

Deprecated: use `authPostBSWithAuthMethod`

Conduct POST request with access token only in the request body but header.

authPostBS3 Source #

Arguments

:: forall (m :: Type -> Type). MonadIO m |
=> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> PostBody |
-> ExceptT ByteString m ByteString | Response as ByteString

Deprecated: use `authPostBSWithAuthMethod`

Conduct POST request with access token only in the header and not in body

authPostJSONWithAuthMethod Source #

Arguments

:: forall (m :: Type -> Type) a. (MonadIO m, FromJSON a) |
=> APIAuthenticationMethod |
-> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> PostBody |
-> ExceptT ByteString m a | Response as ByteString

Conduct POST request and return response as JSON. Allow to specify how to append AccessToken.

Since: 2.6.0

authPostJSONInternal Source #

Arguments

:: forall (m :: Type -> Type) a. (MonadIO m, FromJSON a) |
=> APIAuthenticationMethod |
-> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> PostBody |
-> ExceptT ByteString m a | Response as ByteString

Deprecated: use `authPostJSONWithAuthMethod`

authPostBSWithAuthMethod Source #

Arguments

:: forall (m :: Type -> Type). MonadIO m |
=> APIAuthenticationMethod |
-> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> PostBody |
-> ExceptT ByteString m ByteString | Response as ByteString

Conduct POST request and return response as ByteString. Allow to specify how to append AccessToken.

Since: 2.6.0

authPostBSInternal Source #

Arguments

:: forall (m :: Type -> Type). MonadIO m |
=> APIAuthenticationMethod |
-> Manager | HTTP connection manager.
-> AccessToken |
-> URI |
-> PostBody |
-> ExceptT ByteString m ByteString | Response as ByteString

Deprecated: use `authPostBSWithAuthMethod`

# Types

data APIAuthenticationMethod Source #

https://www.rfc-editor.org/rfc/rfc6750#section-2

Constructors

AuthInRequestHeader | Provides in Authorization header
AuthInRequestBody | Provides in request body
AuthInRequestQuery | Provides in request query parameter

#### Instances

Instances details

Eq APIAuthenticationMethod Source # |
Instance details Defined in Network.OAuth.OAuth2.HttpClient Methods (==) :: APIAuthenticationMethod -> APIAuthenticationMethod -> Bool Source # (/=) :: APIAuthenticationMethod -> APIAuthenticationMethod -> Bool Source #
Ord APIAuthenticationMethod Source # |

Instance details

Defined in Network.OAuth.OAuth2.HttpClient

Methods

compare :: APIAuthenticationMethod -> APIAuthenticationMethod -> Ordering Source #

(<) :: APIAuthenticationMethod -> APIAuthenticationMethod -> Bool Source #

(<=) :: APIAuthenticationMethod -> APIAuthenticationMethod -> Bool Source #

(>) :: APIAuthenticationMethod -> APIAuthenticationMethod -> Bool Source #

(>=) :: APIAuthenticationMethod -> APIAuthenticationMethod -> Bool Source #

max :: APIAuthenticationMethod -> APIAuthenticationMethod -> APIAuthenticationMethod Source #

min :: APIAuthenticationMethod -> APIAuthenticationMethod -> APIAuthenticationMethod Source #