【发布时间】:2013-09-19 06:51:33
【问题描述】:
我有使用 Owin 部署在 Azure 上的 WorkerRole 中的 WebAPI。
我现在想尝试身份验证。 (请记住,因为我是工人角色,所以没有前端)。
我似乎找不到任何关于此主题的示例或博客文章,我想知道这里是否有人做过任何事情并可以指出一些示例。
我一直在查看 Microsoft.Owin.Security.*,但我没有看到如何在我的 owin 启动中使用它们的链接。
我已经把这个放在启动中了:
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.ExternalAuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = CookieAuthenticationDefaults.ExternalAuthenticationType,
AuthenticationMode = AuthenticationMode.Active,
CookieName = CookieAuthenticationDefaults.CookiePrefix + CookieAuthenticationDefaults.ExternalAuthenticationType,
ExpireTimeSpan = TimeSpan.FromMinutes(5),
});
app.UseMicrosoftAccountAuthentication( "hidden", "hidden");
我的下一步是什么,当我完成了前端时如何进行身份验证。 javascript 或控制台应用程序中显示的示例即可。
【问题讨论】:
标签: asp.net-web-api owin