| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Network.OAuth2
Description
A lightweight oauth2 Haskell binding. See Readme for more details
Synopsis
- data OAuth2 = OAuth2 {}
- data ClientAuthenticationMethod
- newtype ExchangeToken = ExchangeToken {}
- newtype RefreshToken = RefreshToken {}
- newtype AccessToken = AccessToken {}
- newtype IdToken = IdToken {}
- type PostBody = [(ByteString, ByteString)]
- type QueryParams = [(ByteString, ByteString)]
- defaultRequestHeaders :: [(HeaderName, ByteString)]
- addDefaultRequestHeaders :: Request -> Request
- appendQueryParams :: [(ByteString, ByteString)] -> URIRef a -> URIRef a
- uriToRequest :: MonadThrow m => URI -> m Request
- authorizationUrl :: OAuth2 -> URI
- authorizationUrlWithParams :: QueryParams -> OAuth2 -> URI
- module Network.OAuth2.TokenRequest
- module Network.OAuth2.HttpClient
Documentation
Query Parameter Representation
Constructors
| OAuth2 | |
data ClientAuthenticationMethod Source #
How would the Client (RP) authenticate itself?
The client MUST NOT use more than one authentication method in each request. Means use Authorization header or Post body.
See more details
https://www.rfc-editor.org/rfc/rfc6749#section-2.3 https://oauth.net/private-key-jwt/ https://www.rfc-editor.org/rfc/rfc7523.html
Constructors
| ClientSecretBasic | |
| ClientSecretPost | |
| ClientAssertionJwt |
Instances
| Show ClientAuthenticationMethod Source # | |
Defined in Network.OAuth2.Internal Methods showsPrec :: Int -> ClientAuthenticationMethod -> ShowS # show :: ClientAuthenticationMethod -> String # showList :: [ClientAuthenticationMethod] -> ShowS # | |
| Eq ClientAuthenticationMethod Source # | |
Defined in Network.OAuth2.Internal Methods (==) :: ClientAuthenticationMethod -> ClientAuthenticationMethod -> Bool # (/=) :: ClientAuthenticationMethod -> ClientAuthenticationMethod -> Bool # | |
newtype ExchangeToken Source #
Authorization Code
Constructors
| ExchangeToken | |
Instances
| FromJSON ExchangeToken Source # | |
Defined in Network.OAuth2.Internal Methods parseJSON :: Value -> Parser ExchangeToken # parseJSONList :: Value -> Parser [ExchangeToken] # | |
| ToJSON ExchangeToken Source # | |
Defined in Network.OAuth2.Internal Methods toJSON :: ExchangeToken -> Value # toEncoding :: ExchangeToken -> Encoding # toJSONList :: [ExchangeToken] -> Value # toEncodingList :: [ExchangeToken] -> Encoding # omitField :: ExchangeToken -> Bool # | |
| Show ExchangeToken Source # | |
Defined in Network.OAuth2.Internal Methods showsPrec :: Int -> ExchangeToken -> ShowS # show :: ExchangeToken -> String # showList :: [ExchangeToken] -> ShowS # | |
| ToQueryParam ExchangeToken Source # | |
Defined in Network.OAuth2.Experiment.Types Methods toQueryParam :: ExchangeToken -> Map Text Text Source # | |
newtype RefreshToken Source #
Constructors
| RefreshToken | |
Instances
| FromJSON RefreshToken Source # | |
Defined in Network.OAuth2.Internal | |
| ToJSON RefreshToken Source # | |
Defined in Network.OAuth2.Internal Methods toJSON :: RefreshToken -> Value # toEncoding :: RefreshToken -> Encoding # toJSONList :: [RefreshToken] -> Value # toEncodingList :: [RefreshToken] -> Encoding # omitField :: RefreshToken -> Bool # | |
| Show RefreshToken Source # | |
Defined in Network.OAuth2.Internal Methods showsPrec :: Int -> RefreshToken -> ShowS # show :: RefreshToken -> String # showList :: [RefreshToken] -> ShowS # | |
| Eq RefreshToken Source # | |
Defined in Network.OAuth2.Internal | |
| ToQueryParam RefreshToken Source # | |
Defined in Network.OAuth2.Experiment.Types Methods toQueryParam :: RefreshToken -> Map Text Text Source # | |
newtype AccessToken Source #
Constructors
| AccessToken | |
Instances
| FromJSON AccessToken Source # | |
Defined in Network.OAuth2.Internal | |
| ToJSON AccessToken Source # | |
Defined in Network.OAuth2.Internal Methods toJSON :: AccessToken -> Value # toEncoding :: AccessToken -> Encoding # toJSONList :: [AccessToken] -> Value # toEncodingList :: [AccessToken] -> Encoding # omitField :: AccessToken -> Bool # | |
| Show AccessToken Source # | |
Defined in Network.OAuth2.Internal Methods showsPrec :: Int -> AccessToken -> ShowS # show :: AccessToken -> String # showList :: [AccessToken] -> ShowS # | |
| Eq AccessToken Source # | |
Defined in Network.OAuth2.Internal | |
type PostBody = [(ByteString, ByteString)] Source #
Type synonym of post body content
type QueryParams = [(ByteString, ByteString)] Source #
Type sysnonym of request query params
defaultRequestHeaders :: [(HeaderName, ByteString)] Source #
addDefaultRequestHeaders :: Request -> Request Source #
Set several header values: + userAgennt : "hoauth2" + accept : "application/json"
appendQueryParams :: [(ByteString, ByteString)] -> URIRef a -> URIRef a Source #
uriToRequest :: MonadThrow m => URI -> m Request Source #
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
module Network.OAuth2.TokenRequest
OAuth'ed http client utilities
module Network.OAuth2.HttpClient