Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Keycloak #209

Conversation

NotActuallyTerry
Copy link
Contributor

This PR adds the ability to sync memberships from Keycloak groups to GitHub teams.

Right now, this only supports syncing from groups within a single Keycloak realm. If the need arises, I could look into adding support for defining the realm within the sync map.
As Keycloak supports using GitHub as an IdP, if you have this set up you can enable KEYCLOAK_USE_GITHUB_IDP to use their linked GitHub username directly. Further down the line it might be ideal to look at using the GitHub account ID in the sync.

This integration allows Github Team Sync to pull group data from Keycloak via its admin REST API.
Users can choose to do a username sync as normal, or they can link to an existing Github account by enabling KEYCLOAK_USE_GITHUB_IDP. This requires the user to add Github as an Identity provider on the user's realm.
@primetheus
Copy link
Collaborator

Thanks for opening this up @NotActuallyTerry! I'll do some testing and get it merged in for a new release!

Defining members as None then adding group members to it appears to work in newer Python versions. However, this results in a TypeError in 3.9.
Changing this to define an empty list from the outset works better, and I probably should've done that to begin with
@NotActuallyTerry
Copy link
Contributor Author

No worries! I've pushed another commit fixing an issue that I ran into. Turns out my pipenv didn't fully override the system Python, so something that works in 3.11 but doesn't work in 3.9 slipped through 🤦

@NotActuallyTerry NotActuallyTerry force-pushed the notactuallyterry/keycloak-integration branch from baac1ad to 7bc7723 Compare May 28, 2024 12:35
@NotActuallyTerry NotActuallyTerry force-pushed the notactuallyterry/keycloak-integration branch from 7bc7723 to a44359a Compare May 28, 2024 12:52
@primetheus primetheus merged commit 3132837 into 3rd-party-integrations:main Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants