我正在尝试使用 IdentityServer3 对带有 owin 管道(无 mvc)的 asp.net webform 应用程序上的用户进行身份验证
所有示例都建议像 mvc 应用程序一样配置应用程序,但是当我尝试访问 webform 应用程序的受保护资源时,应用程序不会重定向到 IdentityServer 登录页面
这是我的客户端(网络表单)配置
[启动.cs]
app.UseCookieAuthentication(new CookieAuthenticationOptions {
AuthenticationMode = AuthenticationMode.Active,
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie
//LoginPath = new PathString ("/Account/Login") //<--enabling this path property redirect me to a local login page but not to the external IdentityServer login page
});
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
Authority = "https://localhost:44300/identity", //<<--url of the identityServer
ClientId = "webform",
ClientSecret = "ciccio",
Scope = "openid profile roles",
RedirectUri = "https://localhost:44302/", //<-- url of the client (to come back ofter the login)
ResponseType = "id_token",
SignInAsAuthenticationType = "Cookies"
});
我确定我忘记了什么