I am using reference tokens on my Identity Server and want to pass some additional data to the client.
I know how to do this with a JWT by setting claims in my Profile S
You can implement (and register) the ICustomTokenRequestValidator
interface which could help adding custom response parameters :
public class DefaultClientClaimsAdder : ICustomTokenRequestValidator
{
public Task ValidateAsync(CustomTokenRequestValidationContext context)
{
context.Result.CustomResponse = new Dictionary<string, object>
{
{"hello", "world" }
};
return Task.FromResult(0);
}
}
Register it in Startup.cs
in identity server app:
services.AddTransient<ICustomTokenRequestValidator, DefaultClientClaimsAdder>();
The custom property will include in token response :