Repository navigation
User Migration from external Service #21062
Replies: 1 comment 1 reply
|
I dont know how to configure your flow, but i can point to other options.
@Override
public boolean isValid(RealmModel realmModel, UserModel userModel, CredentialInput credentialInput) {
// credentialInput.getChallengeResponse() raw password
var result= externalService.login(userModel.getUsername(), credentialInput.getChallengeResponse());
if(result.getStatus() ==LoginStatus.FAILED){
return false;
}
// save password to keycloak
userModel.credentialManager().updateCredential(credentialInput);
}when all users will be login at least once you can disable your custom user federation |
I dont know how to configure your flow, but i can point to other options.
If you know how the hash algorithm is implemented in external services, then you sync hashed passwords into keycloak, after that you can create your own plugin with implemented PasswordHashProviderFactory here is an example https://github.com/pavelbogomolenko/keycloak-custom-password-hash/blob/master/src/main/java/org/keycloak/examples/providers/credential/hash/CustomPasswordHashProvider.java
(How i did it) implemente UserStorageProvider, ImportSynchronization, CredentialInputValidator.
UserStorageProvider and ImportSynchronization are responsible for sync users between external service and keycloak. But with Cr…