Currently, we have successfully implemented custom login page in keycloak, however we are facing another issue which is user password update on the first login. When i access to keycloak with the username and password like
val token = keycloak.keycloakForFetchUserToken(
authentication.principal.toString(),
authentication.credentials.toString()
).tokenManager().accessToken
fun keycloakForFetchUserToken(username:String, password: String): Keycloak {
return KeycloakBuilder.builder()
.serverUrl(KeycloakAttributes.SERVER_URL.value())
.username(username)
.password(password)
.realm(KeycloakAttributes.REALM.value())
.clientId(KeycloakAttributes.CLIENT_ID.value())
.clientSecret(KeycloakAttributes.CLIENT_SECRET.value())
.resteasyClient(ResteasyClientBuilder().connectionPoolSize(20).register(CustomJacksonProvider()).build())
.build()
}
When tried to get access token it is throwing 401 unauthorized so it is obvious i cant access to the token of this user because it is locked by keycloak. BUT, as long as I know i can connect to the keycloak and fetch this user's data and see it has required actions like update_password right?, So lets say I got it BUT the question is how can i go forward? like sending the user to the update page?
Has anybody have solution to this problem.