Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.OAuth.OAuth2
Description
A lightweight oauth2 Haskell binding. See Readme for more details
Synopsis
- portLens :: Lens' Request Int
- data OAuth2 = OAuth2 {}
- data ClientAuthenticationMethod
- newtype RefreshToken = RefreshToken {}
- data OAuth2Token = OAuth2Token {}
- type PostBody = [(ByteString, ByteString)]
- uriToRequest :: MonadThrow m => URI -> m Request
- newtype ExchangeToken = ExchangeToken {}
- newtype AccessToken = AccessToken {}
- newtype IdToken = IdToken {}
- type QueryParams = [(ByteString, ByteString)]
- defaultRequestHeaders :: [(HeaderName, ByteString)]
- appendQueryParams :: [(ByteString, ByteString)] -> URIRef a -> URIRef a
- hostLens :: Lens' Request ByteString
- requestToUri :: Request -> URI
- authorizationUrl :: OAuth2 -> URI
- authorizationUrlWithParams :: QueryParams -> OAuth2 -> URI
- module Network.OAuth.OAuth2.TokenRequest
- module Network.OAuth.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.OAuth.OAuth2.Internal Methods showsPrec :: Int -> ClientAuthenticationMethod -> ShowS # show :: ClientAuthenticationMethod -> String # showList :: [ClientAuthenticationMethod] -> ShowS # | |
Eq ClientAuthenticationMethod Source # | |
Defined in Network.OAuth.OAuth2.Internal Methods (==) :: ClientAuthenticationMethod -> ClientAuthenticationMethod -> Bool # (/=) :: ClientAuthenticationMethod -> ClientAuthenticationMethod -> Bool # |
newtype RefreshToken Source #
Constructors
RefreshToken | |
Instances
FromJSON RefreshToken Source # | |
Defined in Network.OAuth.OAuth2.Internal | |
ToJSON RefreshToken Source # | |
Defined in Network.OAuth.OAuth2.Internal Methods toJSON :: RefreshToken -> Value # toEncoding :: RefreshToken -> Encoding # toJSONList :: [RefreshToken] -> Value # toEncodingList :: [RefreshToken] -> Encoding # omitField :: RefreshToken -> Bool # | |
Show RefreshToken Source # | |
Defined in Network.OAuth.OAuth2.Internal Methods showsPrec :: Int -> RefreshToken -> ShowS # show :: RefreshToken -> String # showList :: [RefreshToken] -> ShowS # | |
Eq RefreshToken Source # | |
Defined in Network.OAuth.OAuth2.Internal | |
ToQueryParam RefreshToken Source # | |
Defined in Network.OAuth2.Experiment.Types Methods toQueryParam :: RefreshToken -> Map Text Text Source # |
data OAuth2Token Source #
Constructors
OAuth2Token | |
Fields
|
Instances
FromJSON OAuth2Token Source # | Parse JSON data into |
Defined in Network.OAuth.OAuth2.Internal | |
ToJSON OAuth2Token Source # | |
Defined in Network.OAuth.OAuth2.Internal Methods toJSON :: OAuth2Token -> Value # toEncoding :: OAuth2Token -> Encoding # toJSONList :: [OAuth2Token] -> Value # toEncodingList :: [OAuth2Token] -> Encoding # omitField :: OAuth2Token -> Bool # | |
Binary OAuth2Token Source # | |
Defined in Network.OAuth.OAuth2.Internal | |
Show OAuth2Token Source # | |
Defined in Network.OAuth.OAuth2.Internal Methods showsPrec :: Int -> OAuth2Token -> ShowS # show :: OAuth2Token -> String # showList :: [OAuth2Token] -> ShowS # | |
Eq OAuth2Token Source # | |
Defined in Network.OAuth.OAuth2.Internal |
type PostBody = [(ByteString, ByteString)] Source #
Type synonym of post body content
uriToRequest :: MonadThrow m => URI -> m Request Source #
newtype ExchangeToken Source #
Authorization Code
Constructors
ExchangeToken | |
Instances
FromJSON ExchangeToken Source # | |
Defined in Network.OAuth.OAuth2.Internal Methods parseJSON :: Value -> Parser ExchangeToken # parseJSONList :: Value -> Parser [ExchangeToken] # | |
ToJSON ExchangeToken Source # | |
Defined in Network.OAuth.OAuth2.Internal Methods toJSON :: ExchangeToken -> Value # toEncoding :: ExchangeToken -> Encoding # toJSONList :: [ExchangeToken] -> Value # toEncodingList :: [ExchangeToken] -> Encoding # omitField :: ExchangeToken -> Bool # | |
Show ExchangeToken Source # | |
Defined in Network.OAuth.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 AccessToken Source #
Constructors
AccessToken | |
Instances
FromJSON AccessToken Source # | |
Defined in Network.OAuth.OAuth2.Internal | |
ToJSON AccessToken Source # | |
Defined in Network.OAuth.OAuth2.Internal Methods toJSON :: AccessToken -> Value # toEncoding :: AccessToken -> Encoding # toJSONList :: [AccessToken] -> Value # toEncodingList :: [AccessToken] -> Encoding # omitField :: AccessToken -> Bool # | |
Show AccessToken Source # | |
Defined in Network.OAuth.OAuth2.Internal Methods showsPrec :: Int -> AccessToken -> ShowS # show :: AccessToken -> String # showList :: [AccessToken] -> ShowS # | |
Eq AccessToken Source # | |
Defined in Network.OAuth.OAuth2.Internal |
type QueryParams = [(ByteString, ByteString)] Source #
Type sysnonym of request query params
defaultRequestHeaders :: [(HeaderName, ByteString)] Source #
appendQueryParams :: [(ByteString, ByteString)] -> URIRef a -> URIRef a Source #
requestToUri :: Request -> URI 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