令牌认证的根路由 [英] Root routing for token authentication

查看:103
本文介绍了令牌认证的根路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Friends,



我是MVC 4.0的初学者,想在http上访问我的Web应用程序时对用户进行身份验证。我有一个具有键值的对象(用户名,权限,令牌,安全密钥)。我想在顶级父路由中传递这些信息,以便可以访问每个http post / get请求以验证每个请求。但不使用COOKIES



谢谢!



Chandrakant

解决方案

您应该遵循asp.net内置的身份验证概念。这并不意味着您只能使用内置成员资格和角色提供程序。正如我所见,你必须建立自己的自定义提供者,至少是成员资格。

以下是它的一般概念: http ://msdn.microsoft.com/en-us/library/f1kyba5e(v = vs.100).aspx [ ^ ]

以下是您可以从以下开始的两个示例:自定义会员提供商 [ ^ ],使用Web服务的自定义MembershipProvider和RoleProvider实现 [ ^ ]

当然,您可以设置asp.net身份验证o无cookie(独立于提供商本身),请参阅: http://msdn.microsoft.com /en-us/library/aa479314.aspx [ ^ ]

Hello Friends,

I am beginner into MVC 4.0 and wanted to authenticate a user while accessing my web application on http. I am having an object with key values(username, permissions, token,secure key). I want to pass these information in top parent route so it can be accessable to every http post/get request to authenticate every request. But not using COOKIES.

Thank you !

Chandrakant

解决方案

You should follow the asp.net built-in authentication concepts. This does not mean, that you can use only the built-in membership and role providers. As I see you will have to build your own custom providers at least that for membership.
Here are the general concepts of it: http://msdn.microsoft.com/en-us/library/f1kyba5e(v=vs.100).aspx[^]
And here are two samples you could start from: Custom Membership Providers[^], Custom MembershipProvider and RoleProvider Implementations that use Web Services[^]
And of course, you can set up asp.net authentication to be cookie-less (independent of the provider itself), see: http://msdn.microsoft.com/en-us/library/aa479314.aspx[^]


这篇关于令牌认证的根路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆