Store user id in Principal or Identity? ASP.Net/OpenID

I have an ASP.Net MVC web application using forms authentication. I use OpenID for authentication.

At the moment, I am saving the url openID inside the Namestandard one GenericIdentity. I would also like to have easy access to the database id for the user.

I can create a custom provider or identifier by overriding a function Application_AuthenticateRequest.

My question is, should the uid database for the user go to the main or identifier?

Should the Name Identity property be a public URL (the user can have many of them, but I would like to display it on every page) or the uid database?

+3
source share
1 answer

Now I think that I should just save the user ID in Identity and hang it on the public URL in the session.

This way, I will not need an individual identifier or basic element.

+3
source

Source: https://habr.com/ru/post/1702385/


All Articles