I'm developing MVC 2 web application. I'm using FormsAuthentication for sign in users to my application. 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). Please help me to solve this problem.
-
What "other application" - one you control or something else?Brian Mains– Brian Mains2016-11-03 14:51:58 +00:00Commented Nov 3, 2016 at 14:51
-
Thanks Brian for your reply. That application also control by us. Once user successfully login to main application I want to generate an authentication token and pass it to that application. Users who login to that application authenticated using that authentication token.bhathiya.m– bhathiya.m2016-11-04 05:16:37 +00:00Commented Nov 4, 2016 at 5:16
Add a comment
|
1 Answer
At best, FormsAuthentication has a GetAuthCookie method which gets the cookie details for a logged-in user. It's not really good for token-based authentication though. You can, however, share the forms auth cookies across web applications. There are restrictions involved, but here is some documentation (and this for ASP.NET Core) to help understand where to begin.