Skip to content

Commit

Permalink
Update troubleshooting docs to include audience claim guidance
Browse files Browse the repository at this point in the history
Added details about the `IdentityServerOptions.EmitStaticAudienceClaim` property for configuring JWT audience claims. This enhances clarity on how to meet token validation requirements for specific implementations.

#468
  • Loading branch information
khalidabuhakmeh committed Jan 31, 2025
1 parent 0a06766 commit 2010b06
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions IdentityServer/v7/docs/content/troubleshooting/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,23 @@ Data protected data can contain '--' (two dashes) and some firewalls disallow th
The Microsoft.IdentityModel.\* libraries used by Duende IdentityServer all have to be of exactly the same version. If they are not it can cause unexpected issues reading configuration data and tokens, i.e. **IDX10500: Signature validation failed. No security keys were provided to validate the signature.** or **System.MissingMethodException: Method not found 'Boolean Microsoft.IdentityModel.Tokens.TokenUtilities.IsRecoverableConfiguration(...)'**

See [our guide]({{< ref "wilson" >}}) for more information on how to diagnose and fix version issues.

## IdentityServerOptions.EmitStaticAudienceClaim and Token Validation

Some token validation implementations require that all valid JWTs
include an audience claim with the key/value of *"aud"* and *"&lt;issuer&gt;/resources"*.
The *IdentityServerOptions.EmitStaticAudience* property's default value is *false*.
To add an audience claim to tokens created by IdentityServer, set the
value of *IdentityServerOptions.EmitStaticAudienceClaim* to *true* during the setup
of your IdentityServer instance.

```csharp
services.AddIdentityServer(options =>
{
// add "aud" claim to JWT
options.EmitStaticAudienceClaim = true;
})
.AddClientStore<ClientStore>()
.AddInMemoryIdentityResources(IdentityResources)
.AddInMemoryApiScopes(ApiScopes);
```

0 comments on commit 2010b06

Please sign in to comment.