验证和授权ServiceStack.MVC [英] Authentication and Authorization with ServiceStack.MVC

查看:442
本文介绍了验证和授权ServiceStack.MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AuthorizeAttribute是无用的,而使用ServiceStack.Mvc

AuthorizeAttribute is useless while using ServiceStack.Mvc

AuthenticateAttribute是DTO对象。

AuthenticateAttribute is for DTO objects.

有对的AccountController与ServiceStack没有样品,Signout不SocialBootStrapApi工作。

There is no sample for AccountController with ServiceStack, Signout is not working in SocialBootStrapApi.

在哪里是基本的登录,注销,授权与ServiceStack.Mvc样的角色? (不是单页的申请书,经典Asp.Net MVC)

Where is the basic Login,Logout,Authorize with Roles samples with ServiceStack.Mvc? (Not single page application, classic Asp.Net Mvc)

推荐答案

ServiceStack不使用ASP.NET的,或者例如依赖于它的MVC的身份验证或任何MVC的的AccountController,它使用自己的认证提供商

ServiceStack doesn't use the ASP.NET's or MVC's Authentication or anything that relies on it e.g. MVC's AccountController, it uses its own Authentication Provider.

AuthenticateAttribute和任何其他ServiceStack 请求或响应滤波器属性其实也可以在DTO的和服务都使用了。

AuthenticateAttribute and any other ServiceStack Request or Response Filter attributes can in fact be used on both the DTO's and the Service.

如果您从<一个继承href=\"https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack.FluentValidation.Mvc3/Mvc/ServiceStackController.cs\"相对=nofollow> ServiceStackController 那么你可以使用ServiceStack的属性过滤器在<一个href=\"https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack.FluentValidation.Mvc3/Mvc/ExecuteServiceStackFiltersAttribute.cs\"相对=nofollow> [ExecuteServiceStackFilters]不被执行,例如

If you inherit from ServiceStackController then you can use ServiceStack's Attribute Filters in [ExecuteServiceStackFilters] do get executed, e.g.


  • [授权]

  • [RequiredRole]

  • [RequiredPermission]

这篇关于验证和授权ServiceStack.MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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