Safe Haskell | None |
---|---|
Language | Haskell2010 |
Authorization grant flow implementation. You probably want Client
.
Synopsis
- data GrantError
- sign :: UTCTime -> Claims -> JWK -> ExceptT JWTError IO Assertion
- refresh :: UTCTime -> Manager -> TokenEndpoint -> Claims -> JWK -> ExceptT GrantError IO Response
- local :: UTCTime -> TokenState -> Maybe AccessToken
- grant :: Store -> IO (Either GrantError AccessToken)
Documentation
data GrantError Source #
SerialisationGrantError Text | |
JWTGrantError JWTError | |
EndpointGrantError Text | |
StatusGrantError Int Text |
Instances
Eq GrantError Source # | |
Defined in Network.OAuth2.JWT.Client.AuthorizationGrant (==) :: GrantError -> GrantError -> Bool # (/=) :: GrantError -> GrantError -> Bool # | |
Show GrantError Source # | |
Defined in Network.OAuth2.JWT.Client.AuthorizationGrant showsPrec :: Int -> GrantError -> ShowS # show :: GrantError -> String # showList :: [GrantError] -> ShowS # |
refresh :: UTCTime -> Manager -> TokenEndpoint -> Claims -> JWK -> ExceptT GrantError IO Response Source #
local :: UTCTime -> TokenState -> Maybe AccessToken Source #
Obtain an already aquired access token iff it is still valid.
grant :: Store -> IO (Either GrantError AccessToken) Source #
Obtain an access token, if we have already aquired one (and it is still valid) we will re-use that token, if we don't already have a token or the token has expired, we go and ask for a new one.
This operation is safe to call from multiple threads. If we are using a current token reads will happen concurrently, If we have to go to the network the request will be serialised so that only one request is made for a new token.