你可以连接一个快速定制的AuthorizeAttribute来检查自定义的Auth cookie。只需在Beta版下装饰你的控制器,并在你准备好时删除它们。
像这样的东西(PS - 这篇关于未经测试的飞):
public class BetaTestAuthorize : AuthorizeAttribute
{
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
//if(cookie checks out ok)
//return true;
//else
//httpContext.Response.Redirect("BetaLoginPage");
return base.AuthorizeCore(httpContext);
}
}
有这样的操作方法这样:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult BetaLogin(string username, string password)
{
if(username == "whatever" && password == "whatever")
{
//create custom cookie
return RedirectToAction("Index", "Home");
}
else
return View();
}
您可以为成员资格提供者提供一个接口,并在您上线时更改该接口的实现吗? – 2010-01-08 18:23:59
嗯,我不确定。我使用OpenID作为我的会员供应商。 – user135383 2010-01-08 18:25:17
我之前问过类似的问题,但没有得到太多的活动,所以我很高兴看到这再次问。更多的输入在这里:http://stackoverflow.com/questions/1171897/what-is-the-most-unobtrusive-way-to-add-a-layer-of-security-for-a-private-beta-of – 2010-01-08 19:22:40