Reputation: 11
We have added/Linked user with Identity Provider Using Legacy Store Managers i:e
Case 1: Using Java Code :
FederatedIdentityModel federatedIdentityModel = new FederatedIdentityModel(IDENTITY_PROVIDER_NAME, ExternalIDPUserID, EmailIdOfUser);
UserFederatedStorageProvider userFederatedStorageProvider = ((LegacyStoreManagers) keycloakSession.getProvider(DatastoreProvider.class)).userFederatedStorage();
FederatedIdentityModel isFederatedIdentityModel = userFederatedStorageProvider.getFederatedIdentity(currentKeycloakUser.getId(), IDENTITY_PROVIDER_NAME, realm);
if (isFederatedIdentityModel == null || isFederatedIdentityModel.getUserId() == null)
{
userFederatedStorageProvider.addFederatedIdentity(realm, currentKeycloakUser.getId(), federatedIdentityModel);
}
After doing this I am still not able to see link in UI of Keycloak
http://localhost:50000/auth/admin/realms/{realmName}/users/{userID}/federated-identity Returning Null response
Case 2: If we Link User Using the code from Case 1 and then again try to create link using "Link Account" Button in the UI. Then the link is again created and also visible in UI. Using API call "http://localhost:50000/auth/admin/realms/{realm}/users/{userID}/federated-identity/auth0-oidc-token-exchange" In This Case Link is always visible even if we "Unlink Account". We can still see the link after refreshing the page. We are seeing the error message as "Could not delete mapping: 'Link not found' " when we try to unlink account more than once
Questions: Question 1 : Is it possible that LegacyStoreManagers Support will be removed in the upcoming versions of keycloak? Question 2 : If Legacy Store Managers Support is going to be removed, then is there any other alternate code which we can use to link User with IDP? Question 3 : Is Displaying the User Link In UI is a Bug in keycloak version(24.0.4) and we can expect its fixed in the upcoming versions of keycloak? In this case we can still use Legacy Store Managers?
Thanks
I tried to find replacement of Legacy Store Managers. But i couldn't find it
Upvotes: 0
Views: 27