(get-openid-configuration-url scheme host port realm)
(launch-uri openid-profile)
Returns the qualified launch-uri of an openid-profile
.
Returns the qualified launch-uri of an `openid-profile`.
(make-launch-handler openid-profile)
(make-openid-instance-not-available tried-endpoint error-msg)
Construct a OpenidInstanceNotAvailable
record.
tried-endpoint
: access via active.clojure.openid/openid-instance-not-available-tried-instance
error-msg
: access via active.clojure.openid/openid-instance-not-available-error-msg
Construct a `OpenidInstanceNotAvailable` record. `tried-endpoint`: access via [[active.clojure.openid/openid-instance-not-available-tried-instance]] `error-msg`: access via [[active.clojure.openid/openid-instance-not-available-error-msg]]
(make-openid-profile name
openid-provider-config
client-id
client-secret
scopes
launch-uri
redirect-uri
landing-uri
logout-uri
basic-auth?)
Construct a OpenidProfile
(Wraps all necessary information for a openid identity provider profile.) record.
name
: access via active.clojure.openid/openid-profile-name
openid-provider-config
: access via active.clojure.openid/openid-profile-openid-provider-config
client-id
: access via active.clojure.openid/openid-profile-client-id
client-secret
: access via active.clojure.openid/openid-profile-client-secret
scopes
: access via active.clojure.openid/openid-profile-scopes
launch-uri
: access via active.clojure.openid/openid-profile-launch-uri
redirect-uri
: access via active.clojure.openid/openid-profile-redirect-uri
landing-uri
: access via active.clojure.openid/openid-profile-landing-uri
logout-uri
: access via active.clojure.openid/openid-profile-logout-uri
basic-auth?
: access via active.clojure.openid/openid-profile-basic-auth?
Construct a `OpenidProfile` (Wraps all necessary information for a openid identity provider profile.) record. `name`: access via [[active.clojure.openid/openid-profile-name]] `openid-provider-config`: access via [[active.clojure.openid/openid-profile-openid-provider-config]] `client-id`: access via [[active.clojure.openid/openid-profile-client-id]] `client-secret`: access via [[active.clojure.openid/openid-profile-client-secret]] `scopes`: access via [[active.clojure.openid/openid-profile-scopes]] `launch-uri`: access via [[active.clojure.openid/openid-profile-launch-uri]] `redirect-uri`: access via [[active.clojure.openid/openid-profile-redirect-uri]] `landing-uri`: access via [[active.clojure.openid/openid-profile-landing-uri]] `logout-uri`: access via [[active.clojure.openid/openid-profile-logout-uri]] `basic-auth?`: access via [[active.clojure.openid/openid-profile-basic-auth?]]
(make-openid-profiles! config)
Takes a [[active.clojure.config/Configuration]] and extracts all
configured OpenidProfile
s from the config.
If any openid instance is not available, returns
an [[%openid-instance-not-available]]] condition instead of
an OpenidProfile
for that instance..
Takes a [[active.clojure.config/Configuration]] and extracts all configured [[OpenidProfile]]s from the config. If any openid instance is not available, returns an [[%openid-instance-not-available]]] condition instead of an [[OpenidProfile]] for that instance..
(make-openid-provider-config authorize-endpoint
token-endpoint
userinfo-endpoint
end-session-endpoint
check-session-endpoint
supports-backchannel-logout?)
Construct a OpenIdProviderConfig
record.
authorize-endpoint
: access via active.clojure.openid/openid-provider-config-authorize-endpoint
token-endpoint
: access via active.clojure.openid/openid-provider-config-token-endpoint
userinfo-endpoint
: access via active.clojure.openid/openid-provider-config-userinfo-endpoint
end-session-endpoint
: access via active.clojure.openid/openid-provider-config-end-session-endpoint
check-session-endpoint
: access via active.clojure.openid/openid-provider-config-check-session-endpoint
supports-backchannel-logout?
: access via active.clojure.openid/openid-provider-config-supports-backchannel-logout?
Construct a `OpenIdProviderConfig` record. `authorize-endpoint`: access via [[active.clojure.openid/openid-provider-config-authorize-endpoint]] `token-endpoint`: access via [[active.clojure.openid/openid-provider-config-token-endpoint]] `userinfo-endpoint`: access via [[active.clojure.openid/openid-provider-config-userinfo-endpoint]] `end-session-endpoint`: access via [[active.clojure.openid/openid-provider-config-end-session-endpoint]] `check-session-endpoint`: access via [[active.clojure.openid/openid-provider-config-check-session-endpoint]] `supports-backchannel-logout?`: access via [[active.clojure.openid/openid-provider-config-supports-backchannel-logout?]]
(make-redirect-handler openid-profile
no-auth-code-handler
state-mismatch-handler)
Creates a redirect (callback) handler for a openid-profile
. A
successful login might result in an exceptional state (i.e. when
the server cannot be reached after receiving the code. Such
errors will be returned as a ring-response with code 500 and the
class and message as a Clojure-map.
Creates a redirect (callback) handler for a `openid-profile`. A successful login might result in an exceptional state (i.e. when the server cannot be reached after receiving the code. Such errors will be returned as a ring-response with code 500 and the class and message as a Clojure-map.
(openid-instance-not-available-error-msg rec__3472__auto__)
(openid-instance-not-available-error-msg data__3473__auto__ v__3474__auto__)
Lens for the error-msg
field from a OpenidInstanceNotAvailable
record. See active.clojure.openid/make-openid-instance-not-available
.
Lens for the `error-msg` field from a [[OpenidInstanceNotAvailable]] record. See [[active.clojure.openid/make-openid-instance-not-available]].
(openid-instance-not-available-tried-instance rec__3472__auto__)
(openid-instance-not-available-tried-instance data__3473__auto__
v__3474__auto__)
Lens for the tried-endpoint
field from a OpenidInstanceNotAvailable
record. See active.clojure.openid/make-openid-instance-not-available
.
Lens for the `tried-endpoint` field from a [[OpenidInstanceNotAvailable]] record. See [[active.clojure.openid/make-openid-instance-not-available]].
(openid-instance-not-available? thing)
Is object a OpenidInstanceNotAvailable
record? See active.clojure.openid/make-openid-instance-not-available
.
Is object a `OpenidInstanceNotAvailable` record? See [[active.clojure.openid/make-openid-instance-not-available]].
(openid-logout openid-profile)
Function that performs a logout at the idp for the current user.
Clears the whole :session for the openid-profile
.
Function that performs a logout at the idp for the current user. Clears the whole :session for the `openid-profile`.
(openid-profile-basic-auth? rec__3472__auto__)
(openid-profile-basic-auth? data__3473__auto__ v__3474__auto__)
Lens for the basic-auth?
field from a OpenidProfile
record. See active.clojure.openid/make-openid-profile
.
Lens for the `basic-auth?` field from a [[OpenidProfile]] record. See [[active.clojure.openid/make-openid-profile]].
(openid-profile-client-id rec__3472__auto__)
(openid-profile-client-id data__3473__auto__ v__3474__auto__)
Lens for the client-id
field from a OpenidProfile
record. See active.clojure.openid/make-openid-profile
.
Lens for the `client-id` field from a [[OpenidProfile]] record. See [[active.clojure.openid/make-openid-profile]].
(openid-profile-client-secret rec__3472__auto__)
(openid-profile-client-secret data__3473__auto__ v__3474__auto__)
Lens for the client-secret
field from a OpenidProfile
record. See active.clojure.openid/make-openid-profile
.
Lens for the `client-secret` field from a [[OpenidProfile]] record. See [[active.clojure.openid/make-openid-profile]].
(openid-profile-landing-uri rec__3472__auto__)
(openid-profile-landing-uri data__3473__auto__ v__3474__auto__)
Lens for the landing-uri
field from a OpenidProfile
record. See active.clojure.openid/make-openid-profile
.
Lens for the `landing-uri` field from a [[OpenidProfile]] record. See [[active.clojure.openid/make-openid-profile]].
(openid-profile-launch-uri rec__3472__auto__)
(openid-profile-launch-uri data__3473__auto__ v__3474__auto__)
Lens for the launch-uri
field from a OpenidProfile
record. See active.clojure.openid/make-openid-profile
.
Lens for the `launch-uri` field from a [[OpenidProfile]] record. See [[active.clojure.openid/make-openid-profile]].
(openid-profile-logout-uri rec__3472__auto__)
(openid-profile-logout-uri data__3473__auto__ v__3474__auto__)
Lens for the logout-uri
field from a OpenidProfile
record. See active.clojure.openid/make-openid-profile
.
Lens for the `logout-uri` field from a [[OpenidProfile]] record. See [[active.clojure.openid/make-openid-profile]].
(openid-profile-name rec__3472__auto__)
(openid-profile-name data__3473__auto__ v__3474__auto__)
Lens for the name
field from a OpenidProfile
record. See active.clojure.openid/make-openid-profile
.
Lens for the `name` field from a [[OpenidProfile]] record. See [[active.clojure.openid/make-openid-profile]].
(openid-profile-openid-provider-config rec__3472__auto__)
(openid-profile-openid-provider-config data__3473__auto__ v__3474__auto__)
Lens for the openid-provider-config
field from a OpenidProfile
record. See active.clojure.openid/make-openid-profile
.
Lens for the `openid-provider-config` field from a [[OpenidProfile]] record. See [[active.clojure.openid/make-openid-profile]].
(openid-profile-redirect-uri rec__3472__auto__)
(openid-profile-redirect-uri data__3473__auto__ v__3474__auto__)
Lens for the redirect-uri
field from a OpenidProfile
record. See active.clojure.openid/make-openid-profile
.
Lens for the `redirect-uri` field from a [[OpenidProfile]] record. See [[active.clojure.openid/make-openid-profile]].
(openid-profile-scopes rec__3472__auto__)
(openid-profile-scopes data__3473__auto__ v__3474__auto__)
Lens for the scopes
field from a OpenidProfile
record. See active.clojure.openid/make-openid-profile
.
Lens for the `scopes` field from a [[OpenidProfile]] record. See [[active.clojure.openid/make-openid-profile]].
(openid-profile? thing)
Is object a OpenidProfile
record? See active.clojure.openid/make-openid-profile
.
Is object a `OpenidProfile` record? See [[active.clojure.openid/make-openid-profile]].
(openid-provider-config-authorize-endpoint rec__3472__auto__)
(openid-provider-config-authorize-endpoint data__3473__auto__ v__3474__auto__)
Lens for the authorize-endpoint
field from a OpenIdProviderConfig
record. See active.clojure.openid/make-openid-provider-config
.
Lens for the `authorize-endpoint` field from a [[OpenIdProviderConfig]] record. See [[active.clojure.openid/make-openid-provider-config]].
(openid-provider-config-check-session-endpoint rec__3472__auto__)
(openid-provider-config-check-session-endpoint data__3473__auto__
v__3474__auto__)
Lens for the check-session-endpoint
field from a OpenIdProviderConfig
record. See active.clojure.openid/make-openid-provider-config
.
Lens for the `check-session-endpoint` field from a [[OpenIdProviderConfig]] record. See [[active.clojure.openid/make-openid-provider-config]].
(openid-provider-config-end-session-endpoint rec__3472__auto__)
(openid-provider-config-end-session-endpoint data__3473__auto__ v__3474__auto__)
Lens for the end-session-endpoint
field from a OpenIdProviderConfig
record. See active.clojure.openid/make-openid-provider-config
.
Lens for the `end-session-endpoint` field from a [[OpenIdProviderConfig]] record. See [[active.clojure.openid/make-openid-provider-config]].
(openid-provider-config-supports-backchannel-logout? rec__3472__auto__)
(openid-provider-config-supports-backchannel-logout? data__3473__auto__
v__3474__auto__)
Lens for the supports-backchannel-logout?
field from a OpenIdProviderConfig
record. See active.clojure.openid/make-openid-provider-config
.
Lens for the `supports-backchannel-logout?` field from a [[OpenIdProviderConfig]] record. See [[active.clojure.openid/make-openid-provider-config]].
(openid-provider-config-token-endpoint rec__3472__auto__)
(openid-provider-config-token-endpoint data__3473__auto__ v__3474__auto__)
Lens for the token-endpoint
field from a OpenIdProviderConfig
record. See active.clojure.openid/make-openid-provider-config
.
Lens for the `token-endpoint` field from a [[OpenIdProviderConfig]] record. See [[active.clojure.openid/make-openid-provider-config]].
(openid-provider-config-userinfo-endpoint rec__3472__auto__)
(openid-provider-config-userinfo-endpoint data__3473__auto__ v__3474__auto__)
Lens for the userinfo-endpoint
field from a OpenIdProviderConfig
record. See active.clojure.openid/make-openid-provider-config
.
Lens for the `userinfo-endpoint` field from a [[OpenIdProviderConfig]] record. See [[active.clojure.openid/make-openid-provider-config]].
(openid-provider-config? thing)
Is object a OpenIdProviderConfig
record? See active.clojure.openid/make-openid-provider-config
.
Is object a `OpenIdProviderConfig` record? See [[active.clojure.openid/make-openid-provider-config]].
(prefixed-uri openid-profile uri)
Returns a uri
prefixed with the name of the openid-profile
.
Returns a `uri` prefixed with the name of the `openid-profile`.
(redirect-uri openid-profile)
Returns the qualified redirect-uri of an openid-profile
.
Returns the qualified redirect-uri of an `openid-profile`.
(reitit-routes openid-profiles
&
[{:keys [no-auth-code-handler state-mismatch-handler]
:or {no-auth-code-handler default-no-auth-code-handler
state-mismatch-handler default-state-mismatch-handler}}])
Based on a sequence of OpenidProfile
s, returns a vector of two
reitit routes that handle the initial login launch and the openid
callback.
Takes an optional map with up to two keys
:no-auth-code-handler
: Handler that the callback handler calls
on the result when no authentication code is provided. Defaults
to default-no-auth-code-handler
.
:state-mismatch-handler
: Handle the callback handler calls on
the result when the state provided by this applcication doesn't
match the state given in the response of the idp. Defaults
to default-state-mismatch-handler
.
Each of them will be applied to every profile.
After a login attempt, the identity provider calls the provided callback handler which results in three possible scenarios:
A valid login: The login was successful. The callback handler
will use the code provided by the idp and fetches an access token (a
JWT token). The token will be assed to the session under
[::access-tokens <openid-profile-name> <access-token>]
.
The idp didn't provide an authorization code. The callback handler returns the [[no-auth-code-response]].
The state code's did not match. The callback handle rreturns the [[state-mismatch-response]].
Based on a sequence of [[OpenidProfile]]s, returns a vector of two reitit routes that handle the initial login launch and the openid callback. Takes an optional map with up to two keys - `:no-auth-code-handler`: Handler that the callback handler calls on the result when no authentication code is provided. Defaults to [[default-no-auth-code-handler]]. - `:state-mismatch-handler`: Handle the callback handler calls on the result when the state provided by this applcication doesn't match the state given in the response of the idp. Defaults to [[default-state-mismatch-handler]]. Each of them will be applied to _every_ profile. After a login attempt, the identity provider calls the provided callback handler which results in three possible scenarios: 1. A valid login: The login was successful. The callback handler will use the code provided by the idp and fetches an access token (a JWT token). The token will be assed to the session under `[::access-tokens <openid-profile-name> <access-token>]`. 2. The idp didn't provide an authorization code. The callback handler returns the [[no-auth-code-response]]. 3. The state code's did not match. The callback handle rreturns the [[state-mismatch-response]].
(reitit-routes-for-profile openid-profile
no-auth-code-handler
state-mismatch-handler)
For a given OpenidProfile
, returns a vector containing the launch-
and login-callback handlers.
For a given [[OpenidProfile]], returns a vector containing the launch- and login-callback handlers.
(req->access-token-for-profile req openid-profile)
Returns the access token for openid-profile
if there is one.
Returns the access token for `openid-profile` if there is one.
(req->access-token-type-for-profile req openid-profile)
Returns the access token's type for openid-profile
if there is
one.
Returns the access token's type for `openid-profile` if there is one.
(req->access-tokens req)
Returns a map of all access-tokens from a ring req
. The format
is [name-of-profile access-token].
Returns a map of all access-tokens from a ring `req`. The format is [name-of-profile access-token].
(req->openid-profile req openid-profiles)
Get the OpenidProfile
out of openid-profiles
that is used for
req
. Assumes there is only one active session.
Get the [[OpenidProfile]] out of `openid-profiles` that is used for `req`. Assumes there is only one active session.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close