Add support for user sync for users created via wordpress #521
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
My use case is, that when a user buys something via woocomerce and creates a user, the user should be synced to keycloak. Currently there is a Plugin WordPress Single Sign-On SSO that has in the 700$ tier this functionality. The problem is, it uses saml and not oidc and also i need to write custom theme hooks for elementor so i implemented this with openid-connect-generic.
Another use case would be to use event plugins that are creating users for event registrations etc.
I used the
user_register
filter and when no url is entered nothing happens. I used the keycloak admin rest api for getting an access token, creating a user and setting a password.If needed i can provide a minimal keycloak docker compose repo.
Room for improvements
Sync also metadata to keycloak or provide a function to do so.
Closes #520 .
How to test the changes in this Pull Request:
endpoint_usercreation
in the settings or via env varor
4. set up woocomerce
5. checkout + create User account + enter a password
or
4. add this code somewhere
Other information:
I didn't manage to get the test run.
This line in the pull request template has a typo
https://github.com/oidc-wp/openid-connect-generic/blob/develop/.github/PULL_REQUEST_TEMPLATE.md?plain=1#L3C30-L3C59
And the https://github.com/oidc-wp/openid-connect-generic/wiki/How-to-setup-the-plugin-development-environment has wrong commands because
npm start
should benpm run start
, but that doesn't exist either.Changelog entry