keycloak-user-migration
keycloak-user-migration copied to clipboard
feat: add federated identity
The Google Identity provider is not supported, but the user is successfully migrated when the Google user sign-in plugin is available. But there is a problem with the web page the user is facing. The web page shows two options (edit profile and add existing account). Because there is a user from the legacy system, this option appears.
The purpose of this pull request is to solve this web page issue. The user should be redirected to the home page.
But... this doesn't quite solve the problem. This PR prevents the mentioned options from appearing if the user tries again log in with google (second time).
First time:
But as I said, for the second time, that page doesn't show up (which is the goal of this PR).
Issue #37 discusses this PR
SonarCloud Quality Gate failed. 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
36.2% Coverage
0.0% Duplication
Catch issues before they fail your Quality Gate with our IDE extension
SonarLint
Hi and thanks for the contribution :) Sorry it took me so long to get to this MR.
My thoughts:
- I think
legacyFederatedIdentitiesshould be made optional in the JSON (and therefore in the code), to not break compatibility with existing clients. - It's not clear what values
identityProvidercan have or what atokenis in the JSON, nor which properties of alegacyFederatedIdentitiesitem are actually required. Could you add some info about those to the README? - This seems important enough to test end-to-end. Could you write a Cypress test for it? You could modify one of the users in the test app's InMemoryUserRepository to have a federated identity and then check if it's properly migrated. Otherwise, I assume the test would be very similar to the
should migrate usertest. This would also prove that this MR works as intended. - The code needs to have 100% code coverage (see: SonarCloud analysis).
Regards, Daniel Frąk.
I just took a longer look at the README.md on master and the hypocrisy is not lost on me in that none of the response fields are marked as required/optional or properly described XD So I guess you can skip point number 2 if you don't feel like doing it (though I think it would be really helpful for everyone if it was documented properly).