Skip to content

Commit 97d5a09

Browse files
committed
Added section about adding DCR to the Disco
1 parent eb76b46 commit 97d5a09

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

  • astro/src/content/docs/identityserver/configuration

astro/src/content/docs/identityserver/configuration/dcr.mdx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,46 @@ and configure the store implementation.
190190

191191
</Steps>
192192

193+
### Adding the Registration Endpoint to the Discovery Document
194+
195+
By default, the Dynamic Client Registration (DCR) endpoint is not included in the [discovery document](/identityserver/reference/endpoints/discovery.md) of Duende IdentityServer.
196+
197+
To include it, change the Discovery Document options when registering IdentityServer in the service collection:
198+
199+
```csharp
200+
// Program.cs
201+
builder.Services.AddIdentityServer(options =>
202+
{
203+
// Either use a static URL for the registration endpoint, when hosted outside of IdentityServer:
204+
options.Discovery.DynamicClientRegistration.RegistrationEndpointMode =
205+
RegistrationEndpointMode.Static;
206+
207+
options.Discovery.DynamicClientRegistration.StaticRegistrationEndpoint =
208+
new Uri("https://my-configuration-api/connect/dcr");
209+
210+
// Or use inferred when the registration endpoint is hosted within IdentityServer:
211+
options.Discovery.DynamicClientRegistration.RegistrationEndpointMode =
212+
RegistrationEndpointMode.Inferred;
213+
});
214+
```
215+
216+
:::note
217+
DCR support was added to Duende IdentityServer v7.4. If you cannot upgrade your IdentityServer solution yet,
218+
you'll have to add custom entries to the Discovery Document instead:
219+
220+
```csharp
221+
// Program.cs
222+
using Duende.IdentityModel;
223+
224+
builder.Services.AddIdentityServer(options =>
225+
{
226+
options.Discovery.CustomEntries.Add
227+
OidcConstants.Discovery.RegistrationEndpoint,
228+
"https://my-configuration-api/connect/dcr");
229+
});
230+
```
231+
:::
232+
193233
## Authorization
194234

195235
When implementing Dynamic Client Registration (DCR), it is important to consider

0 commit comments

Comments
 (0)