简体   繁体   English

如何从一个 MVC5 应用程序获取访问令牌到另一个 MVC5 应用程序

[英]How to get access token from one MVC5 application to another MVC5 application

I am trying to get access token from one .net MVC application to another MVC application.我正在尝试从一个 .net MVC 应用程序获取访问令牌到另一个 MVC 应用程序。 My requirement is: I have Two .net MVC projects "A" and "B" under the same solution, where authentication is done under the project "A".我的要求是:我在同一解决方案下有两个 .net MVC 项目“A”和“B”,其中身份验证在项目“A”下完成。 I want Project "B" to consume the authentication token from project "A".我希望项目“B”使用来自项目“A”的身份验证令牌。

Please suggest a suitable approach.请提出合适的方法。

You can share authentication cookies between your apps.您可以在您的应用程序之间共享身份验证 cookies。 I implemented this solution in a portal that was split into multiple projects and subdomains.我在一个分成多个项目和子域的门户中实现了这个解决方案。

ASP.NET Core: ASP.NET 内核:

Share authentication cookies among ASP.NET apps 在 ASP.NET 应用程序之间共享身份验证 cookies

ASP.NET 4.x: ASP.NET 4.x:

Sharing Authorization Cookies 分享授权 Cookies

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM