OIDC integration with Kanidm #1907
stratself
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I've successfully integrated my Technitium against Kanidm, with auto-mapping roles for new sign-ups. I'd like to share my configuration here.
Let's assume the setup below:
https://idm.example.comhttps://dns.testdomain.net:53443Let's also assume I want to map a Kanidm group called
technitium_adminsto be Administrators inside Technitium. That group will contain mytestuseraccount.graph TB subgraph "idm.example.com (Kanidm)" user:test-user -->|part of| group:technitium_admins end group:technitium_admins -->|claim:roles:admin|dns["dns.testdomain.net:53443 (Technitium)"]Kanidm
First, login to kanidm with the CLI and follow the prompts:
Then, create a new group called
technitium_admins, and add my user to it:Next, create an OAuth2 client object called
technitiumwith relevant Technitium URLs. We will then add the appropriate scopes (openidandprofile) to this client.Then, define
rolesas a custom claim for thetechnitium_adminsgroup, with a value ofadmin.This way, Technitium can receive this mapping when it fetches an ID token from Kanidm, to use with its role-mapping policy decisions.
Technitium
First, fetch the basic secret from kanidm:
Then inside Technitium's web UI, go to Settings > Administration > Single Sign On (SSO) and enter the following details:
https://idm.example.com/oauth2/openid/technitiumtechnitiumadminto correspond with a Local Group of Administrators.Click on "Save Config", your changes should now be applied.
The login screen should now has an OpenID Connect option. Click on it and sign-in with Kanidm, and you'll be redirected back to Technitium. Under the My Profile popup, you should see your account as a "Member of" the "Administrators" group.
Extras
Add another group
If you want to define another group and mapping, create it in Kanidm, add it to the
technitiumOAuth client, and configure the right claim(s) for it. Also, you can employ multiple claims too, so that a Kanidm group can take up multiple roles inside Technitium.Here is an example with a
technitium_dhcp_dnsgroup in Kanidm:Behavior with clustering
OIDC enablement will be replicated across the cluster, so they will all share the same client ID and secret. To enable logging in from another cluster node, simply add its callback path as a redirect URL:
Conclusion
If you run into any troubles, check logs of both Kanidm and Technitium. For the latter, it is recommended to still maintain an internal admin account to debug these cases.
It would be nice if the role mapping claim field can be customized. So instead of being limited to only
rolesandgroups, it can be an arbitrary field liketechnitium_groupsfor less confusion on the IDM side.Beta Was this translation helpful? Give feedback.
All reactions