Safe Haskell | None |
---|---|
Language | Haskell2010 |
An OpenID connect provider.
OpenID Connect is a simple identity layer on top of the OAuth2 protocol. Learn more about it here: https://openid.net/connect/
Since: 0.2.3.0
Synopsis
- data OpenIDConnect
- discover :: Text -> IO OpenIDConnect
- discoverURI :: URI -> IO OpenIDConnect
- oidcClientId :: OpenIDConnect -> Text
- oidcClientSecret :: OpenIDConnect -> Text
- oidcProviderInfo :: OpenIDConnect -> ProviderInfo
- oidcManager :: OpenIDConnect -> Maybe Manager
- oidcScopes :: OpenIDConnect -> [Text]
- oidcAllowedSkew :: OpenIDConnect -> NominalDiffTime
- getAccessToken :: Request -> Maybe OAuth2Token
- getIdToken :: Request -> Maybe ClaimsSet
Creating a provider
data OpenIDConnect Source #
An Open ID Connect provider.
To create a value use discover
to download configuration for an existing
provider, then use various setter functions to customize it.
Since: 0.2.3.0
Instances
FromJSON OpenIDConnect Source # | |
Defined in Network.Wai.Middleware.Auth.OIDC parseJSON :: Value -> Parser OpenIDConnect # parseJSONList :: Value -> Parser [OpenIDConnect] # | |
AuthProvider OpenIDConnect Source # | |
Defined in Network.Wai.Middleware.Auth.OIDC getProviderName :: OpenIDConnect -> Text Source # getProviderInfo :: OpenIDConnect -> ProviderInfo Source # handleLogin :: OpenIDConnect -> Request -> [Text] -> Render ProviderUrl -> (AuthLoginState -> IO Response) -> (Status -> ByteString -> IO Response) -> IO Response Source # refreshLoginState :: OpenIDConnect -> Request -> AuthUser -> IO (Maybe (Request, AuthUser)) Source # |
discover :: Text -> IO OpenIDConnect Source #
Fetch configuration for a provider from its discovery
endpoint. Sets the path to .well-known..
.
Since: 0.2.3.0
discoverURI :: URI -> IO OpenIDConnect Source #
Fetch configuration for a provider from an exact URI.
Since: 0.2.3.1
Customizing a provider
oidcClientId :: OpenIDConnect -> Text Source #
The client id this application is registered with at the Open ID Connect provider. The default is an empty string, you will need to overwrite this.
Since: 0.2.3.0
oidcClientSecret :: OpenIDConnect -> Text Source #
The client secret of this application. The default is an empty string, you will need to overwrite this.
Since: 0.2.3.0
oidcProviderInfo :: OpenIDConnect -> ProviderInfo Source #
The information for this provider. The default contains some placeholder texts. If you're using the provider screen you'll want to overwrite this.
Since: 0.2.3.0
oidcManager :: OpenIDConnect -> Maybe Manager Source #
The HTTP manager to use. Defaults to the global manager when not set.
Since: 0.2.3.0
oidcScopes :: OpenIDConnect -> [Text] Source #
The scopes to set. Defaults to only the "openid" scope.
Since: 0.2.3.0
oidcAllowedSkew :: OpenIDConnect -> NominalDiffTime Source #
The amount of clock skew to allow when validating id tokens. Defaults to 0.
Since: 0.2.3.0
Accessing session data
getAccessToken :: Request -> Maybe OAuth2Token Source #
Get the AccessToken
for the current user.
If called on a Request
behind the middleware, should always return a
Just
value.
Since: 0.2.0.0