Closed fidenz-shehanF closed 6 years ago
I have not tried it, but I think the OnAuthenticated
event is the correct one, as that is triggered before the AuthenticationTicket
is created:
https://github.com/auth0/auth0-aspnet-owin/blob/master/src/Auth0.Owin/Auth0AuthenticationHandler.cs#L130
Are you having problems with it?
Yeah it is. What i want to achieve is edit those claims that comes. currently for user's Name it gives me the email of that user. i want to change that to the user's name. i cant edit them since those claim properties are read only.
I think you will have to remove the claim, and then add it back with the new value.
Please note however that we will retire this library in the next few weeks though. We want customers to start using the standard OWIN 4 OpenID Connect middleware
hmm yeah i got that confused. i replaced that claim with what the claim that i want thank you. Does that mean that Auth0 will not support applications that uses this library ?
I cannot comment right now on that, as this needs to be finalised. I will keep you updated once we have everything in place with steps for migrating.
hmm we are currently building a web app using this library. Hope the change will not effect to the applications that already uses this library like ours. cause its kinda gonna be a hassle to migrate our code base as well yeah. Anyways thanks on quick response and the help.
It may be best then, if you can, to switch to using the OWIN 4 OpenIdConnect middleware as soon as possible before you get to far along with this lib.
You can refer to this Startup
class for how to configure it:
https://github.com/auth0/auth0-aspnet-owin/blob/owin4/test/Auth0OwinTest/Startup.cs
You will need to install the Nuget package Microsoft.Owin.Security.OpenIdConnect
version 4.0.0
Will check this out soon, thank you.
Hi,
Is there a way that we can edit default claims ? like say, i need to change the Name field property that is coming from auth0 side using a local database value. currently Name field contains the email. i want to change that. is there a way? im currently trying to do this in the OnAuthenticated handler. Thanks