Hi,
I need to add a custom claim on login. All example code I have seen assumes that we extend AccountController.SignInAsync in order to do this. However, the current version now uses SignInManager.SignInOrTwoFactor.
Could you please tell me how I can now insert a custom claim on login.
Thank you.
9 Answer(s)
-
0
You and bunch of other people are still waiting for a reply on this :)
-
0
Hi @BBakerMMC,
Sorry for the delay. It will be ready tomorrow.
Thanks.
-
0
Hi,
I have created a new gist for this, you can check it out here <a class="postlink" href="https://gist.github.com/ismcagdas/6f2a9a3b5d7b907cb8d94a72124d59a1">https://gist.github.com/ismcagdas/6f2a9 ... 72124d59a1</a>.
Thanks.
-
0
Thank you.
-
0
thanks for your feedback
-
0
Apologies, but I have just realised that the example given is for Core. Would you please be able to give an example of how this could be achieved in MVC5.
Thank you.
-
0
Hi @PhilWynn,
Yes, it is for ASP.NET Core, we will prepare one for MVC 5.x in a short time.
-
0
Thank you.
I have another related issue. I am using the method you propose to save data against a user session. The problem I am now getting is that many of my unit tests, that rely on this data, are now failing. How can I inject this new session data into the unit tests?
Many thanks
-
0
Hi,
I could also use the MVC 5 example. Any news on this?
Thanks.