Client¶
The Client class models an OpenID Connect or OAuth 2.0 client -
e.g. a native application, a web application or a JS-based application.
Basics¶
EnabledSpecifies if client is enabled. Defaults to true.
ClientIdUnique ID of the client
ClientSecretsList of client secrets - credentials to access the token endpoint.
RequireClientSecretSpecifies whether this client needs a secret to request tokens from the token endpoint (defaults to
true)RequireRequestObjectSpecifies whether this client needs to wrap the authorize request parameters in a JWT (defaults to
false)AllowedGrantTypesSpecifies the grant types the client is allowed to use. Use the
GrantTypesclass for common combinations.RequirePkceSpecifies whether clients using an authorization code based grant type must send a proof key (defaults to
true).AllowPlainTextPkceSpecifies whether clients using PKCE can use a plain text code challenge (not recommended - and default to
false)RedirectUrisSpecifies the allowed URIs to return tokens or authorization codes to
AllowedScopesBy default a client has no access to any resources - specify the allowed resources by adding the corresponding scopes names
AllowOfflineAccessSpecifies whether this client can request refresh tokens (be requesting the
offline_accessscope)AllowAccessTokensViaBrowserSpecifies whether this client is allowed to receive access tokens via the browser. This is useful to harden flows that allow multiple response types (e.g. by disallowing a hybrid flow client that is supposed to use code id_token to add the token response type and thus leaking the token to the browser.
PropertiesDictionary to hold any custom client-specific values as needed.
Authentication/Logout¶
PostLogoutRedirectUrisSpecifies allowed URIs to redirect to after logout. See the OIDC Connect Session Management spec for more details.
FrontChannelLogoutUriSpecifies logout URI at client for HTTP based front-channel logout. See the OIDC Front-Channel spec for more details.
FrontChannelLogoutSessionRequiredSpecifies if the user’s session id should be sent to the FrontChannelLogoutUri. Defaults to true.
BackChannelLogoutUriSpecifies logout URI at client for HTTP based back-channel logout. See the OIDC Back-Channel spec for more details.
BackChannelLogoutSessionRequiredSpecifies if the user’s session id should be sent in the request to the BackChannelLogoutUri. Defaults to true.
EnableLocalLoginSpecifies if this client can use local accounts, or external IdPs only. Defaults to true.
IdentityProviderRestrictionsSpecifies which external IdPs can be used with this client (if list is empty all IdPs are allowed). Defaults to empty.
UserSsoLifetimeadded in 2.3The maximum duration (in seconds) since the last time the user authenticated. Defaults to
null. You can adjust the lifetime of a session token to control when and how often a user is required to reenter credentials instead of being silently authenticated, when using a web application.
Token¶
IdentityTokenLifetimeLifetime to identity token in seconds (defaults to 300 seconds / 5 minutes)
AllowedIdentityTokenSigningAlgorithmsList of allowed signing algorithms for identity token. If empty, will use the server default signing algorithm.
AccessTokenLifetimeLifetime of access token in seconds (defaults to 3600 seconds / 1 hour)
AuthorizationCodeLifetimeLifetime of authorization code in seconds (defaults to 300 seconds / 5 minutes)
AbsoluteRefreshTokenLifetimeMaximum lifetime of a refresh token in seconds. Defaults to 2592000 seconds / 30 days
SlidingRefreshTokenLifetimeSliding lifetime of a refresh token in seconds. Defaults to 1296000 seconds / 15 days
RefreshTokenUsageReUsethe refresh token handle will stay the same when refreshing tokensOneTimethe refresh token handle will be updated when refreshing tokens. This is the default.RefreshTokenExpirationAbsolutethe refresh token will expire on a fixed point in time (specified by the AbsoluteRefreshTokenLifetime). This is the default.Slidingwhen refreshing the token, the lifetime of the refresh token will be renewed (by the amount specified in SlidingRefreshTokenLifetime). The lifetime will not exceed AbsoluteRefreshTokenLifetime.UpdateAccessTokenClaimsOnRefreshGets or sets a value indicating whether the access token (and its claims) should be updated on a refresh token request.
AccessTokenTypeSpecifies whether the access token is a reference token or a self contained JWT token (defaults to Jwt).
IncludeJwtIdSpecifies whether JWT access tokens should have an embedded unique ID (via the jti claim). Defaults to
true.AllowedCorsOriginsIf specified, will be used by the default CORS policy service implementations (In-Memory and EF) to build a CORS policy for JavaScript clients.
ClaimsAllows settings claims for the client (will be included in the access token).
AlwaysSendClientClaimsIf set, the client claims will be sent for every flow. If not, only for client credentials flow (default is false)
AlwaysIncludeUserClaimsInIdTokenWhen requesting both an id token and access token, should the user claims always be added to the id token instead of requiring the client to use the userinfo endpoint. Default is false.
ClientClaimsPrefixIf set, the prefix client claim types will be prefixed with. Defaults to client_. The intent is to make sure they don’t accidentally collide with user claims.
PairWiseSubjectSaltSalt value used in pair-wise subjectId generation for users of this client.
Consent Screen¶
RequireConsentSpecifies whether a consent screen is required. Defaults to
false.AllowRememberConsentSpecifies whether user can choose to store consent decisions. Defaults to
true.ConsentLifetimeLifetime of a user consent in seconds. Defaults to null (no expiration).
ClientNameClient display name (used for logging and consent screen)
ClientUriURI to further information about client (used on consent screen)
LogoUriURI to client logo (used on consent screen)
Device flow¶
UserCodeTypeSpecifies the type of user code to use for the client. Otherwise falls back to default.
DeviceCodeLifetimeLifetime to device code in seconds (defaults to 300 seconds / 5 minutes)