Override Claims in access token for every silent renew
I'm adding claims from external service when trying to logging to present in access token. I would like to update the claim value for every silent renew. Is overriding the DefaultTokenService is the correct way or do we have any specific class to override?
Thanks in advance
You should implement your own IProfileService
public async Task GetProfileDataAsync(ProfileDataRequestContext context)
{
// check for access token
if (context.Caller == IdentityServerConstants.ProfileDataCallers.ClaimsProviderAccessToken)
{
// add custom claims
context.IssuedClaims.Add(new Claim("mycustomclaim", "newvalue"));
}
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.