# Validation

> Reference documentation for Dynamic Client Registration (DCR) validation process, including validation steps, interfaces, and client property configuration.

## IDynamicClientRegistrationValidator

[Section titled âIDynamicClientRegistrationValidatorâ](#idynamicclientregistrationvalidator)

The `IDynamicClientRegistrationValidator` is the contract for the service that validates a dynamic client registration request. It contains a single `ValidateAsync(...)` method.

Conceptually, the validation step is responsible for checking the validity of the metadata supplied in the registration request, and using that metadata to set properties of a `Client` model. In contrast, the `IDynamicClientRegistrationRequestProcessor` is responsible for setting properties on the `Client` model that are generated by the Configuration API itself.

### IDynamicClientRegistrationValidator.ValidateAsync

[Section titled âIDynamicClientRegistrationValidator.ValidateAsyncâ](#idynamicclientregistrationvalidatorvalidateasync)

Validates a dynamic client registration request.

```csharp
public Task<IDynamicClientRegistrationValidationResult> ValidateAsync(
    DynamicClientRegistrationContext context)
```

| parameter | description                                   |
| --------- | --------------------------------------------- |
| context   | Contextual information about the DCR request. |

### Return Value

[Section titled âReturn Valueâ](#return-value)

A task that returns an [`IDynamicClientRegistrationValidationResult`](/identityserver/reference/dcr/models/#idynamicclientregistrationvalidationresult), indicating success or failure.

## DynamicClientRegistrationValidator

[Section titled âDynamicClientRegistrationValidatorâ](#dynamicclientregistrationvalidator)

```csharp
public class DynamicClientRegistrationValidator : IDynamicClientRegistrationValidator
```

The `DynamicClientRegistrationValidator` class is the default implementation of the `IDynamicClientRegistrationValidator`. If you need to customize some aspect of Dynamic Client Registration validation, we recommend that you extend this class and override the appropriate methods.

## Validation Steps

[Section titled âValidation Stepsâ](#validation-steps)

Each of these methods represents one step in the validation process. Each step is passed a [`DynamicClientRegistrationContext`](/identityserver/reference/dcr/models/#dynamicclientregistrationcontext) and returns a task that returns an [`IStepResult`](/identityserver/reference/dcr/models/#istepresult). The `DynamicClientRegistrationContext` includes the client model that will have its properties set, the DCR request, and other contextual information. The `IStepResult` either represents that the step succeeded or failed.

The steps are invoked in the same order as they appear in this table.

| name                              | description                                                                                                                                                                                                                                                                                                     |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ValidateSoftwareStatementAsync(â¦) | Validates the software statement of the request. The default implementation does nothing, and is included as an extension point.                                                                                                                                                                                |
| SetGrantTypesAsync(â¦)             | Validates requested grant types and uses them to set the allowed grant types of the client.                                                                                                                                                                                                                     |
| SetRedirectUrisAsync(â¦)           | Validates requested redirect uris and uses them to set the redirect uris of the client.                                                                                                                                                                                                                         |
| SetScopesAsync(â¦)                 | Validates requested scopes and uses them to set the scopes of the client.                                                                                                                                                                                                                                       |
| SetDefaultScopes(â¦)               | Sets scopes on the client when no scopes are requested. The default implementation sets no scopes and is intended as an extension point.                                                                                                                                                                        |
| SetSecretsAsync(â¦)                | Validates the requested jwks to set the secrets of the client.                                                                                                                                                                                                                                                  |
| SetClientNameAsync(â¦)             | Validates the requested client name uses it to set the name of the client.                                                                                                                                                                                                                                      |
| SetLogoutParametersAsync(â¦)       | Validates the requested client parameters related to logout and uses them to set the corresponding properties in the client. Those parameters include the post logout redirect uris, front channel and back channel uris, and flags for the front and back channel uris indicating if they require session ids. |
| SetMaxAgeAsync(â¦)                 | Validates the requested default max age and uses it to set the user sso lifetime of the client.                                                                                                                                                                                                                 |
| SetUserInterfaceProperties(â¦)     | Validates details of the request that control the user interface, including the logo uri, client uri, initiate login uri, enable local login flag, and identity provider restrictions, and uses them to set the corresponding client properties.                                                                |
| SetPublicClientProperties(â¦)      | Validates the requested client parameters related to public clients and uses them to set the corresponding properties in the client. Those parameters include the require client secret flag and the allowed cors origins.                                                                                      |
| SetAccessTokenProperties(â¦)       | Validates the requested client parameters related to access tokens and uses them to set the corresponding properties in the client. Those parameters include the allowed access token type and access token lifetime.                                                                                           |
| SetIdTokenProperties(â¦)           | Validates the requested client parameters related to id tokens and uses them to set the corresponding properties in the client. Those parameters include the id token lifetime and the allowed id token signing algorithms.                                                                                     |
| SetServerSideSessionProperties(â¦) | Validates the requested client parameters related to server side sessions and uses them to set the corresponding properties in the client. Those parameters include the coordinate lifetime with user session flag.                                                                                             |
-----