-
Notifications
You must be signed in to change notification settings - Fork 66
Update to use a startup script for keycloak-oidc #1244
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6dcd7e9
Update to use a startup script for keycloak-oidc
ZohebShaikh 7cb2ea1
Update health check for keycloak
ZohebShaikh 07bdc15
Increase sleep time for keycloak
ZohebShaikh ab694f3
Update the startup time for compose yaml
ZohebShaikh 1e1185c
Update client secret to secret
ZohebShaikh 5676c70
Add comments
ZohebShaikh fa2cb27
Add more documentation
ZohebShaikh ce5898e
Add docs for logout
ZohebShaikh 6edce90
Add proper name for keycloak
ZohebShaikh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/bin/bash | ||
| export PATH=$PATH:/opt/keycloak/bin | ||
|
|
||
| # Wait for Keycloak to start up | ||
| sleep 30 | ||
| while ! kcadm.sh config credentials --server http://localhost:8080 --realm master --user admin --password admin; do | ||
| sleep 1 | ||
| done | ||
|
|
||
| # Add users to Keycloak | ||
| for user in alice bob carol; do | ||
| kcadm.sh create users -r master -s username="$user" -s enabled=true | ||
| kcadm.sh set-password -r master --username "$user" --new-password "$user" | ||
| done | ||
|
|
||
| # Retrieve all allowed protocol mappers for client registration | ||
| allowed_protocol_mappers=$(kcadm.sh get components -q name="Allowed Protocol Mapper Types" --fields id --format csv --noquotes) | ||
|
|
||
| # Enable oidc-audience-mapper for all allowed protocol mappers to support tiled client registration | ||
| for mapper_id in $allowed_protocol_mappers; do | ||
| kcadm.sh update components/$mapper_id -s 'config.allowed-protocol-mapper-types=[ "saml-user-attribute-mapper", "saml-user-property-mapper", "oidc-usermodel-property-mapper", "oidc-usermodel-attribute-mapper", "oidc-full-name-mapper", "oidc-address-mapper", "oidc-audience-mapper", "oidc-sha256-pairwise-sub-mapper", "saml-role-list-mapper" ]' | ||
| done | ||
|
|
||
| kcreg.sh config credentials --server http://localhost:8080 --realm master --user admin --password admin | ||
|
|
||
| for client in tiled-cli tiled; do | ||
| kcreg.sh get $client >/dev/null 2>&1 || kcreg.sh create --file "/mnt/$client.json" | ||
| done |
65 changes: 65 additions & 0 deletions
65
example_configs/keycloak_oidc/keycloak_config/tiled-cli.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| { | ||
| "id" : "194bca53-a569-4411-925e-217d8d6d21cf", | ||
| "clientId" : "tiled-cli", | ||
| "name" : "", | ||
| "description" : "Tiled client for Device flow login ", | ||
| "rootUrl" : "", | ||
| "adminUrl" : "", | ||
| "baseUrl" : "", | ||
| "surrogateAuthRequired" : false, | ||
| "enabled" : true, | ||
| "alwaysDisplayInConsole" : false, | ||
| "clientAuthenticatorType" : "client-secret", | ||
| "defaultRoles" : [ ], | ||
| "redirectUris" : [ "/*" ], | ||
| "webOrigins" : [ "/*" ], | ||
| "notBefore" : 0, | ||
| "bearerOnly" : false, | ||
| "consentRequired" : false, | ||
| "standardFlowEnabled" : false, | ||
| "implicitFlowEnabled" : false, | ||
| "directAccessGrantsEnabled" : false, | ||
| "serviceAccountsEnabled" : false, | ||
| "publicClient" : true, | ||
| "frontchannelLogout" : true, | ||
| "protocol" : "openid-connect", | ||
| "attributes" : { | ||
| "standard.token.exchange.enabled" : "false", | ||
| "frontchannel.logout.session.required" : "true", | ||
| "post.logout.redirect.uris" : "+", | ||
| "oauth2.device.authorization.grant.enabled" : "true", | ||
| "backchannel.logout.revoke.offline.tokens" : "false", | ||
| "use.refresh.tokens" : "true", | ||
| "realm_client" : "false", | ||
| "oidc.ciba.grant.enabled" : "false", | ||
| "client.use.lightweight.access.token.enabled" : "false", | ||
| "backchannel.logout.session.required" : "true", | ||
| "client_credentials.use_refresh_token" : "false", | ||
| "tls.client.certificate.bound.access.tokens" : "false", | ||
| "require.pushed.authorization.requests" : "false", | ||
| "acr.loa.map" : "{}", | ||
| "display.on.consent.screen" : "false", | ||
| "token.response.type.bearer.lower-case" : "false" | ||
| }, | ||
| "authenticationFlowBindingOverrides" : { }, | ||
| "fullScopeAllowed" : true, | ||
| "nodeReRegistrationTimeout" : -1, | ||
| "protocolMappers" : [ { | ||
| "id" : "3a57ab6a-332e-4831-8583-820ae22cb830", | ||
| "name" : "tiled_aud", | ||
| "protocol" : "openid-connect", | ||
| "protocolMapper" : "oidc-audience-mapper", | ||
| "consentRequired" : false, | ||
| "config" : { | ||
| "id.token.claim" : "false", | ||
| "lightweight.claim" : "false", | ||
| "introspection.token.claim" : "true", | ||
| "access.token.claim" : "true", | ||
| "included.custom.audience" : "tiled_aud", | ||
| "userinfo.token.claim" : "false" | ||
| } | ||
| } | ||
| ], | ||
| "defaultClientScopes" : [ "web-origins", "acr", "offline_access", "roles", "profile", "basic", "email" ], | ||
| "optionalClientScopes" : [ "address", "phone", "microprofile-jwt" ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| { | ||
| "id" : "96265cb5-8046-4e06-9095-37ecf65d5bf6", | ||
| "clientId" : "tiled", | ||
| "name" : "Tiled", | ||
| "description" : "Standard flow client used for tiled authentication using oauth2-proxy", | ||
| "rootUrl" : "http://localhost:4180", | ||
| "adminUrl" : "http://localhost:4180", | ||
| "baseUrl" : "http://localhost:4180", | ||
| "surrogateAuthRequired" : false, | ||
| "enabled" : true, | ||
| "alwaysDisplayInConsole" : false, | ||
| "clientAuthenticatorType" : "client-secret", | ||
| "secret" : "secret", | ||
| "defaultRoles" : [ ], | ||
| "redirectUris" : [ "http://localhost:4180/*" ], | ||
| "webOrigins" : [ "http://localhost:4180/*" ], | ||
| "notBefore" : 0, | ||
| "bearerOnly" : false, | ||
| "consentRequired" : false, | ||
| "standardFlowEnabled" : true, | ||
| "implicitFlowEnabled" : false, | ||
| "directAccessGrantsEnabled" : false, | ||
| "serviceAccountsEnabled" : false, | ||
| "publicClient" : false, | ||
| "frontchannelLogout" : true, | ||
| "protocol" : "openid-connect", | ||
| "attributes" : { | ||
| "client.secret.creation.time" : "1756805685", | ||
| "request.object.signature.alg" : "any", | ||
| "request.object.encryption.alg" : "any", | ||
| "client.introspection.response.allow.jwt.claim.enabled" : "false", | ||
| "standard.token.exchange.enabled" : "false", | ||
| "post.logout.redirect.uris" : "http://localhost:4180/*", | ||
| "frontchannel.logout.session.required" : "true", | ||
| "oauth2.device.authorization.grant.enabled" : "false", | ||
| "use.jwks.url" : "false", | ||
| "backchannel.logout.revoke.offline.tokens" : "false", | ||
| "use.refresh.tokens" : "true", | ||
| "realm_client" : "false", | ||
| "oidc.ciba.grant.enabled" : "false", | ||
| "client.use.lightweight.access.token.enabled" : "false", | ||
| "backchannel.logout.session.required" : "true", | ||
| "request.object.required" : "not required", | ||
| "client_credentials.use_refresh_token" : "false", | ||
| "access.token.header.type.rfc9068" : "false", | ||
| "tls.client.certificate.bound.access.tokens" : "false", | ||
| "require.pushed.authorization.requests" : "false", | ||
| "acr.loa.map" : "{}", | ||
| "display.on.consent.screen" : "false", | ||
| "request.object.encryption.enc" : "any", | ||
| "token.response.type.bearer.lower-case" : "false" | ||
| }, | ||
| "authenticationFlowBindingOverrides" : { }, | ||
| "fullScopeAllowed" : true, | ||
| "nodeReRegistrationTimeout" : -1, | ||
| "protocolMappers" : [ { | ||
| "id" : "af58bf06-d7d3-4046-80eb-f58d5ae35aca", | ||
| "name" : "tiled_aud", | ||
| "protocol" : "openid-connect", | ||
| "protocolMapper" : "oidc-audience-mapper", | ||
| "consentRequired" : false, | ||
| "config" : { | ||
| "id.token.claim" : "false", | ||
| "lightweight.claim" : "false", | ||
| "introspection.token.claim" : "true", | ||
| "access.token.claim" : "true", | ||
| "included.custom.audience" : "tiled_aud", | ||
| "userinfo.token.claim" : "false" | ||
| } | ||
| } ], | ||
| "defaultClientScopes" : [ "web-origins", "acr", "roles", "profile", "basic", "email" ], | ||
| "optionalClientScopes" : [ "address", "phone", "offline_access", "microprofile-jwt" ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.