Can't get the OnTokenValidated event
What's the proper way to add my custom claims to the validated token? I used to do it in the "OnTokenValidated" event by using something similar to:
builder.AddOpenIdConnect(o =>
{
o.Events = new OpenIdConnectEvents
{
OnTokenValidated = async ctx =>
{
...
I'm no longer able to do this with the new AzureAD.UI package.
I'm having the same problem, there don't seem to be any events that we can use to add custom claims. I want to add custom claims only when the user is logging in (to prevent my app becoming chatty). Please advise on the best way to do this without breaking the existing API's, or building this from scratch.
We also need this capability. It is extremely important for scenarios where you want to capture login events and either log them, or create a database entry per account.
Looks like this is the same fundamental issue as https://github.com/aspnet/AspNetCore/issues/6447, which we will add better documentation for via https://github.com/aspnet/Docs/issues/10324