Safe Haskell | None |
---|---|
Language | Haskell2010 |
A simple OAuth2 Haskell binding. (This is supposed to be independent of the http client used.)
Synopsis
- data OAuth2 = OAuth2 {}
- newtype AccessToken = AccessToken {}
- newtype RefreshToken = RefreshToken {}
- newtype IdToken = IdToken {}
- newtype ExchangeToken = ExchangeToken {}
- data OAuth2Token = OAuth2Token {}
- parseIntFlexible :: Value -> Parser Int
- data OAuth2Error a = OAuth2Error {}
- parseOAuth2Error :: FromJSON err => ByteString -> OAuth2Error err
- mkDecodeOAuth2Error :: ByteString -> String -> OAuth2Error err
- data APIAuthenticationMethod
- data ClientAuthenticationMethod
- type PostBody = [(ByteString, ByteString)]
- type QueryParams = [(ByteString, ByteString)]
- defaultRequestHeaders :: [(HeaderName, ByteString)]
- appendQueryParams :: [(ByteString, ByteString)] -> URIRef a -> URIRef a
- uriToRequest :: MonadThrow m => URI -> m Request
- requestToUri :: Request -> URI
- hostLens :: Lens' Request ByteString
- portLens :: Lens' Request Int
Data Types
Query Parameter Representation
newtype AccessToken Source #
Instances
Eq AccessToken Source # | |
Defined in Network.OAuth.OAuth2.Internal (==) :: AccessToken -> AccessToken -> Bool # (/=) :: AccessToken -> AccessToken -> Bool # | |
Show AccessToken Source # | |
Defined in Network.OAuth.OAuth2.Internal showsPrec :: Int -> AccessToken -> ShowS # show :: AccessToken -> String # showList :: [AccessToken] -> ShowS # | |
ToJSON AccessToken Source # | |
Defined in Network.OAuth.OAuth2.Internal toJSON :: AccessToken -> Value # toEncoding :: AccessToken -> Encoding # toJSONList :: [AccessToken] -> Value # toEncodingList :: [AccessToken] -> Encoding # | |
FromJSON AccessToken Source # | |
Defined in Network.OAuth.OAuth2.Internal parseJSON :: Value -> Parser AccessToken # parseJSONList :: Value -> Parser [AccessToken] # | |
Binary AccessToken Source # | |
Defined in Network.OAuth.OAuth2.Internal |
newtype RefreshToken Source #
Instances
Eq RefreshToken Source # | |
Defined in Network.OAuth.OAuth2.Internal (==) :: RefreshToken -> RefreshToken -> Bool # (/=) :: RefreshToken -> RefreshToken -> Bool # | |
Show RefreshToken Source # | |
Defined in Network.OAuth.OAuth2.Internal showsPrec :: Int -> RefreshToken -> ShowS # show :: RefreshToken -> String # showList :: [RefreshToken] -> ShowS # | |
ToJSON RefreshToken Source # | |
Defined in Network.OAuth.OAuth2.Internal toJSON :: RefreshToken -> Value # toEncoding :: RefreshToken -> Encoding # toJSONList :: [RefreshToken] -> Value # toEncodingList :: [RefreshToken] -> Encoding # | |
FromJSON RefreshToken Source # | |
Defined in Network.OAuth.OAuth2.Internal parseJSON :: Value -> Parser RefreshToken # parseJSONList :: Value -> Parser [RefreshToken] # | |
Binary RefreshToken Source # | |
Defined in Network.OAuth.OAuth2.Internal |
newtype ExchangeToken Source #
Instances
Show ExchangeToken Source # | |
Defined in Network.OAuth.OAuth2.Internal showsPrec :: Int -> ExchangeToken -> ShowS # show :: ExchangeToken -> String # showList :: [ExchangeToken] -> ShowS # | |
ToJSON ExchangeToken Source # | |
Defined in Network.OAuth.OAuth2.Internal toJSON :: ExchangeToken -> Value # toEncoding :: ExchangeToken -> Encoding # toJSONList :: [ExchangeToken] -> Value # toEncodingList :: [ExchangeToken] -> Encoding # | |
FromJSON ExchangeToken Source # | |
Defined in Network.OAuth.OAuth2.Internal parseJSON :: Value -> Parser ExchangeToken # parseJSONList :: Value -> Parser [ExchangeToken] # |
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
OAuth2Token | |
|
Instances
data OAuth2Error a Source #
Instances
parseOAuth2Error :: FromJSON err => ByteString -> OAuth2Error err Source #
mkDecodeOAuth2Error :: ByteString -> String -> OAuth2Error err Source #
data APIAuthenticationMethod Source #
AuthInRequestHeader | Provides in Authorization header |
AuthInRequestBody | Provides in request body |
AuthInRequestQuery | Provides in request query parameter |
Instances
data ClientAuthenticationMethod Source #
Instances
Types Synonym
type PostBody = [(ByteString, ByteString)] Source #
type synonym of post body content
type QueryParams = [(ByteString, ByteString)] Source #
Utilies
defaultRequestHeaders :: [(HeaderName, ByteString)] Source #
appendQueryParams :: [(ByteString, ByteString)] -> URIRef a -> URIRef a Source #
uriToRequest :: MonadThrow m => URI -> m Request Source #
requestToUri :: Request -> URI Source #