更新时间:2023-12-02 17:41:16
loadUserInfo
不提供用户角色,您可以使用keycloak-js并通过tokenParsed
the loadUserInfo
does not provide the roles of the user you may use the keycloak-js and get the roles by tokenParsed
var Keycloak = require('keycloak-js');
var kc = Keycloak('./keycloak.json');
kc.init().success(function(authenticated) {
alert(JSON.stringify(kc.tokenParsed));
}).error(function() {
alert('failed to initialize');
});
希望有帮助