Keycloak版本16.1.1
keycloak.init({onLoad: 'login-required'}).then(async function (authenticated: any) {
if (!authenticated) {
display error...
} else {
use token to call rest and go to account page
}
一切都很好。登录后,帐户页面将以url显示。
几秒钟后,页面闪烁和url更改为
为什么
我已经用LDAP用户联合会配置了Keycloak。当用户想要登录到应用程序时,他被重定向到Keycloak登录页面,进入uid/pwd,并使用LDAP绑定进行身份验证。
这对我的需求是不够的,因为我想实现一些自定义身份验证逻辑,例如:
public boolean authenticate(String uid, String pwd) {
//1.- validate against LDAP
//2.- do some other validations
return validationResult;
}
我如何将自己的身份验证逻辑包含到Keycloak中?