wai-middleware-auth-0.2.5.1: Authentication middleware that secures WAI application
Safe HaskellNone
LanguageHaskell2010

Network.Wai.Middleware.Auth.OIDC

Description

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

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

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

getIdToken :: Request -> Maybe ClaimsSet Source #

Get the IdToken for the current user.

If called on a Request behind the middleware, should always return a Just value.

The token returned was validated when the request was processed by the middleware.

Since: 0.2.3.0