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

被刻印的时光 ゝ 提交于 2019-12-10 18:20:51

问题


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

At the moment the moment I'm storing the openID url inside the Name of the standard GenericIdentity. I would also like to have easy access to the database id for the user.

I can make a custom provider or identity by overriding the Application_AuthenticateRequest function.

My question is should the database uid for the user go into the principal or the identity?

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


回答1:


I'm thinking now that I should just store the user id in the Identity and hang on to the openid url in the Session.

That way I won't need a custom identity or principal.



来源:https://stackoverflow.com/questions/489306/store-user-id-in-principal-or-identity-asp-net-openid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!