use*_*523 8 asp.net owin openid-connect identityserver4
我有应用程序“A”和一个代码最少的测试应用程序“B”,它们使用 OWIN 启动文件指向我们的身份服务器(Thinktecture)。这在两个启动文件中:
public void Configuration(IAppBuilder app)
{
JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary<string, string>();
var identityServerUri = System.Configuration.ConfigurationManager.AppSettings["IdentityServerUrl"].ToString();
var redirectUri = System.Configuration.ConfigurationManager.AppSettings["RedirectUri"].ToString();
var postLogoutRedirectUri = System.Configuration.ConfigurationManager.AppSettings["PostLogoutRedirectUri"].ToString();
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = "Cookies",
ExpireTimeSpan = TimeSpan.FromMinutes(120),
SlidingExpiration = true
});
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
{
ClientId = "myclientid",
Authority = identityServerUri,
RedirectUri = redirectUri,
PostLogoutRedirectUri = postLogoutRedirectUri,
ResponseType = "id_token",
Scope = "openid profile email",
UseTokenLifetime = false,
SignInAsAuthenticationType = "Cookies"
});
}
Run Code Online (Sandbox Code Playgroud)
如果每次清除 cookie 后只是我在多台不同的机器上尝试,这两个应用程序都可以长时间进行身份验证和登录。当其他人开始尝试登录时,它可能会继续工作,但最终每个人都会开始陷入重定向循环,在那里您会获得身份服务器登录页面,点击登录,然后像往常一样返回应用程序,但是应用程序根本不运行任何代码(Home/Index 是第一个调用的东西,它永远不会在我设置日志记录的地方到达那里)它只是重定向回身份服务器,身份服务器检查并查看它们是否被记录in 并将它们重定向回来,直到最终标头响应变得太大并引发错误的请求错误。这一点,
在重定向问题后清除 cookie 并不能解决问题,并且在我执行上述 1 或 2 之前问题仍然存在。
现在我不知道下一步应该在哪里解决这个问题。除了要求其他几个人全天登录之外,我什至找不到一致地重新创建问题的方法。问题必须与网站有关,而不是身份服务器?以下是两种情况下请求的示例:
登录/重定向成功 http://i68.tinypic.com/11gmzaq.jpg
重定向循环问题(只是一遍又一遍地这样做):http : //i64.tinypic.com/mrztc5.jpg
感谢任何人可以提供的任何指导!!!!
| 归档时间: |
|
| 查看次数: |
1452 次 |
| 最近记录: |