Clients
This content is for v8.x. Switch to the latest version for up-to-date documentation.
clients
Section titled “clients”Array of objects representing client metadata. These clients are referred to as static, they don’t expire, never reload, are always available. In addition to these clients the authorization server will use your adapter’s find method when a non-static client_id is encountered. If you only wish to support statically configured clients and no dynamic registration then make it so that your adapter resolves client find calls with a falsy value (e.g. return Promise.resolve()) and don’t take unnecessary DB trips.
Client’s metadata is validated as defined by the respective specification they’ve been defined in.
default value:
[](Click to expand) Available Metadata
application_type, client_id, client_name, client_secret, client_uri, contacts, default_acr_values, default_max_age, grant_types, id_token_signed_response_alg, initiate_login_uri, jwks, jwks_uri, logo_uri, policy_uri, post_logout_redirect_uris, redirect_uris, require_auth_time, response_types, response_modes, scope, sector_identifier_uri, subject_type, token_endpoint_auth_method, tos_uri, userinfo_signed_response_alg
The following metadata is available but may not be recognized depending on your provider’s configuration.
authorization_encrypted_response_alg, authorization_encrypted_response_enc, authorization_signed_response_alg, backchannel_logout_session_required, backchannel_logout_uri, id_token_encrypted_response_alg, id_token_encrypted_response_enc, introspection_encrypted_response_alg, introspection_encrypted_response_enc, introspection_signed_response_alg, request_object_encryption_alg, request_object_encryption_enc, request_object_signing_alg, request_uris, tls_client_auth_san_dns, tls_client_auth_san_email, tls_client_auth_san_ip, tls_client_auth_san_uri, tls_client_auth_subject_dn, tls_client_certificate_bound_access_tokens, token_endpoint_auth_signing_alg, userinfo_encrypted_response_alg, userinfo_encrypted_response_enc
clientBasedCORS
Section titled “clientBasedCORS”Function used to check whether a given CORS request should be allowed based on the request’s client.
default value:
function clientBasedCORS(ctx, origin, client) { return false;}clientDefaults
Section titled “clientDefaults”Default client metadata to be assigned when unspecified by the client metadata, e.g. During Dynamic Client Registration or for statically configured clients. The default value does not represent all default values, but merely copies its subset. You can provide any used client metadata property in this object.
default value:
{ grant_types: [ 'authorization_code' ], id_token_signed_response_alg: 'RS256', response_types: [ 'code' ], token_endpoint_auth_method: 'client_secret_basic'}(Click to expand) Changing the default client token_endpoint_auth_method
To change the default client token_endpoint_auth_method configure clientDefaults to be an object like so:
{ token_endpoint_auth_method: 'client_secret_post'}(Click to expand) Changing the default client response type to `code id_token`
To change the default client response_types configure clientDefaults to be an object like so:
{ response_types: ['code id_token'], grant_types: ['authorization_code', 'implicit'],}clientAuthMethods
Section titled “clientAuthMethods”Array of supported Client Authentication methods
default value:
[ 'client_secret_basic', 'client_secret_jwt', 'client_secret_post', 'private_key_jwt', 'none'](Click to expand) Supported values list
[ 'none', 'client_secret_basic', 'client_secret_post', 'client_secret_jwt', 'private_key_jwt', 'tls_client_auth', 'self_signed_tls_client_auth', // these methods are only available when features.mTLS is configured]extraClientMetadata
Section titled “extraClientMetadata”Allows for custom client metadata to be defined, validated, manipulated as well as for existing property validations to be extended. Existing properties are snakeCased on a Client instance (e.g. client.redirectUris), new properties (defined by this configuration) will be available with their names verbatim (e.g. client['urn:example:client:my-property'])
extraClientMetadata.properties
Section titled “extraClientMetadata.properties”Array of property names that clients will be allowed to have defined.
default value:
[]extraClientMetadata.validator
Section titled “extraClientMetadata.validator”validator function that will be executed in order once for every property defined in extraClientMetadata.properties, regardless of its value or presence on the client metadata passed in. Must be synchronous, async validators or functions returning Promise will be rejected during runtime. To modify the current client metadata values (for current key or any other) just modify the passed in metadata argument.
default value:
function extraClientMetadataValidator(ctx, key, value, metadata) { // @param ctx - koa request context (only provided when a client is being constructed during // Client Registration Request or Client Update Request // @param key - the client metadata property name // @param value - the property value // @param metadata - the current accumulated client metadata // @param ctx - koa request context (only provided when a client is being constructed during // Client Registration Request or Client Update Request // validations for key, value, other related metadata // throw new errors.InvalidClientMetadata() to reject the client metadata // metadata[key] = value; to (re)assign metadata values // return not necessary, metadata is already a reference}