Keycloak JavaScript Adapter receives 400 Bad Request in Internet Explorer

落花浮王杯 提交于 2019-12-11 15:21:11

问题


I'm using Keycloak's JavaScript Adapter to connect a web application with the SSO of my workplace. The code looks like this (server data is loaded via they keycloak.json file):

const keycloak = Keycloak();
keycloak.init({onLoad: "login-required"}).success(authenticated => {
    ...
}).error(() => {
    ...
});

It works as intended on Firefox and Chrome, but on Internet Explorer (v. 11) the POST request for the token returns a 400 Bad Request. Is this a problem with my configuration of Internet Explorer or of Keycloak-js itself? Here is a screenshot from IE.


回答1:


The solution is fairly simple: The client that Keycloak-js wants to access has to be public so that the client ID can be read and sent to the server. The absence of the property or its data missing from the cookies (Firefox and Chrome apparently solve this themselves) leads to the 400 Bad Request sent from the Keycloak server.



来源:https://stackoverflow.com/questions/52109944/keycloak-javascript-adapter-receives-400-bad-request-in-internet-explorer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!