简体   繁体   English

使用MVC4 Web API创建全局用户身份验证系统

[英]Creating a Global user authentication system using MVC4 web api

I am starting a ASP.NET project soon that will require user authentication to access certain parts of the site. 我即将开始一个ASP.NET项目,该项目需要用户身份验证才能访问站点的某些部分。 There will be multiple sites requiring this authentication system including desktop applications. 将有多个站点需要此身份验证系统,包括桌面应用程序。

I was wondering, is there a way to essentially create a global authentication system using the MVC4 Web API? 我想知道,是否有一种方法可以使用MVC4 Web API来创建全局身份验证系统? I don't mean authenticate the user to access the API, but to allow users to retrieve an authentication token to access the site via the web-api. 我并不是说要对用户进行身份验证以访问API,而是要允许用户检索身份验证令牌以通过Web-api访问站点。

Sorry if this seems a bit confusing, I'm still trying to figure out the best method to use. 抱歉,如果这看起来有些令人困惑,我仍在尝试找出最佳使用方法。

Have a look at Thinktecture. 看看Thinktecture。 They have created a token provider (with a client to show how to use it). 他们已经创建了令牌提供者(与客户端一起展示如何使用它)。 I think this is what you're looking for. 我认为这就是您要寻找的。

http://thinktecture.github.com/ http://thinktecture.github.com/

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

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