在ServiceStack使用ASP.NET成员资格 [英] Use ASP.NET Membership in ServiceStack

查看:206
本文介绍了在ServiceStack使用ASP.NET成员资格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用 asp.net成员 ServiceStack ? (ServiceStack.OrmLite,ServiceStack.Host.AspNet等)

how can i use asp.net membership in ServiceStack ? (ServiceStack.OrmLite , ServiceStack.Host.AspNet , etc )

推荐答案

您可以在自定义路径,即在/ API,它可以让你运行ASP.NET Web窗体和ServiceStack并排侧,然后使用ASP.NET正常ASP.NET成员资格提供程序。

You can host ServiceStack on a custom path, i.e. at /api which lets you run ASP.NET web forms and ServiceStack side-by-side and then use the normal ASP.NET membership provider in ASP.NET.

您可以然后使用ServiceStack它的会话提供份额UserSessions,这里是如何<一个例子href=\"https://github.com/ServiceStack/ServiceStack/blob/9183cdc31acd20a32e6ecbe645aed7a1251d32d2/NuGet/ServiceStack.Host.Mvc/content/App_Start/ControllerBase.cs.pp\"相对=nofollow>实例化MVC 会话 - 您可以使用同样的类ASP.NET

You can then share UserSessions with ServiceStack using its Session Provider, here's an example on how to instantiate a Session with MVC - you can use this same class with ASP.NET.

另一个选择是放弃ASP.NET成员资格提供者,只是坚持到在ServiceStack 内置的身份验证。它包括支持凭据(即用户名/密码 - 你想要什么),但也微博/ Facebook的/基本验证+你自己的。在内存,OrmLite和Redis的后端。

The alternative is to forgo the ASP.NET membership provider and just stick to the built-in authentication in ServiceStack. It includes support for Credentials (i.e. user/pass - what you want) but also Twitter / Facebook / BasicAuth + your own. With In-Memory, OrmLite and Redis backends.

下面是使用的例子网站在同一ServiceStack应用程序的所有身份验证选项与OrmLite后端

Here's an example website of using all authentication options in the same ServiceStack app with an OrmLite backend.

这篇关于在ServiceStack使用ASP.NET成员资格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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