[英]How to generate authentication token after FormsAuthentication success in mvc 2
I'm developing MVC 2 web application. 我正在开发MVC 2 Web应用程序。 I'm using FormsAuthentication for sign in users to my application.
我正在使用FormsAuthentication将用户登录到我的应用程序。 I want to generate an authentication token after users are successfully login to the application.
我想在用户成功登录到应用程序后生成身份验证令牌。 I have to pass that authentication token to another application.
我必须将该身份验证令牌传递给另一个应用程序。 Are there any best ways to accomplish this task using MVC2(.net framework 4.0).
是否有使用MVC2(.net framework 4.0)完成此任务的最佳方法。 Please help me to solve this problem.
请帮我解决这个问题。
At best, FormsAuthentication
has a GetAuthCookie
method which gets the cookie details for a logged-in user. 充其量,
FormsAuthentication
具有GetAuthCookie
方法,该方法获取登录用户的cookie详细信息。 It's not really good for token-based authentication though. 但是,这对于基于令牌的身份验证确实不是很好。 You can, however, share the forms auth cookies across web applications.
但是,您可以在Web应用程序之间共享表单身份验证cookie。 There are restrictions involved, but here is some documentation ( and this for ASP.NET Core ) to help understand where to begin.
涉及到一些限制,但是这里有一些文档 ( 这对于ASP.NET Core来说 ),可以帮助您理解从何处开始。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.