Angular 4的KeyCloak卡在了登录循环中(访问控制) [英] Angular 4 with KeyCloak stuck in login loop (Access Control)

查看:109
本文介绍了Angular 4的KeyCloak卡在了登录循环中(访问控制)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将KeyCloak集成到了Angular应用程序中.运行该应用程序后,我将重定向到KeyCloak登录名.到目前为止,一切都很好.如果我输入了错误的用户名/密码,它将告诉我它是错误的.输入正确的凭据后,它会将我重定向到我的应用程序,但随后它会不断刷新.似乎它每秒都在发送登录请求.

I integrated KeyCloak to my Angular app. Once I run the app, I get redirected to the KeyCloak login. So far so good. If I enter wrong username / password, it will tell me that its wrong. Once I put in the correct credentials, it redirects me to my app but then It just keeps refreshing and refreshing. It seems that it's sending a login request every second.

这是日志给我的:

我确信问题不在于代码的逻辑,而可能在于配置.我在错误中进行了搜索,发现发生了诸如更改

I am sure that the problem is not in the logic of the code, but maybe in configuration. I googled the error and saw that things like changing

localhost:8080

127.0.0.1:8080

可以解决此问题,但就我而言,它什么也没做.

could fix the problem, but it didn't do anything in my case.

推荐答案

我也发生了一些事情.尝试在浏览器上禁用cors(在Chrome中禁用相同来源策略)或进行设置在keycloak中设置的Web Origin

Something was happening to me too. Try disabling cors on the browser (Disable same origin policy in Chrome) or set the Web Origin set in keycloak

这篇关于Angular 4的KeyCloak卡在了登录循环中(访问控制)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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