-
-
Notifications
You must be signed in to change notification settings - Fork 328
Keycloak
Note: This guide was created before there was official docs and hasn't been updated to reflect those instructions. Also it was based on Keycloak 1.9.8 and earlier releases and may be outdated.
Keycloak and mod_auth_openidc
is a great fit for self hosted authentication with user administration. Official docs contains a guide.
There's a sample setup for local OpenID Connect testing using Docker at https://github.com/Reposoft/openidc-keycloak-test.
You create an openid-connect
type "client" in your Keycloak realm. Set access type to "Confidential", get a secret, put that secret in a conf with something like:
OIDCProviderMetadataURL https://keycloak.example.net/auth/realms/Testrealm/.well-known/openid-configuration
OIDCRedirectURI https://myserver.example.not/oauth2callback
OIDCCryptoPassphrase 0123456789
OIDCClientID testclient
OIDCClientSecret ca446a2d-a65f-4e84-95a7-d20eb36989d8
OIDCRemoteUserClaim email
OIDCScope "openid email"
Without an OICDRemoteUserClaim
you'd get usernames like [user-uuid]@[keycloak-realm-url]
which is unuseful. E-mail works well with Keycloak: [email protected]
can authenticate as both user
and the full address.
Single Sign On (SSO) works. Just duplicate your config in multiple VirtualHost
s or httpd instances and modify the OIDCRedirectURI
accordingly. You can add multiple "Valid Redirect URIs" in the Keycloak admin ui.