aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Can't get the OnTokenValidated event

Open Omarkth opened this issue 8 years ago • 3 comments

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.

Omarkth avatar Jul 30 '18 09:07 Omarkth

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.

ghost avatar Sep 17 '18 22:09 ghost

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.

SharePointRadi avatar Sep 18 '18 10:09 SharePointRadi

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

Eilon avatar Jan 10 '19 22:01 Eilon