-
Notifications
You must be signed in to change notification settings - Fork 453
Feature/auth docker setup docs #12459
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 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
00ac342
add: ldap, keycloak oidc setup & sample configurations
mahesh-wor 74d2bee
docs: add auth-docker-setup for configuring ldap/keycloak
mahesh-wor 7384604
ref: docs to mention mapstore src url
mahesh-wor 862c570
removed insecure fallbacks, updated .env.sample and update docs
mahesh-wor bf78eda
support direct ldap, updated samples/envs
mahesh-wor c06f592
disable autocreate user that breaks callback if direct ldap is config…
mahesh-wor 739080a
infra: improve auth stack setup for LDAP, Keycloak, build, and docs
mahesh-wor 9cd7319
tests: Endpoint tests to include ldap properties & service
mahesh-wor 0397a71
fix: updated the sample data-dir & configurations for gs 2.6 related …
mahesh-wor 512e57b
add: sample configs for microsoft entra & updates to group configuration
mahesh-wor cdf04bc
add: sample configs for microsoft entra & lint issues
mahesh-wor 470a323
fix: ldap overides, ldifs in single sample, update docs
mahesh-wor 648fadb
docs: add quick start to docs and test compose stack
mahesh-wor ddec0cc
docs: related to test docker compose stack and profiles
mahesh-wor 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 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,2 @@ | ||
| .git | ||
| node_modules |
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
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,27 @@ | ||
| # Copy to .env and adjust if needed. | ||
| # The variables below are SAMPLE values for local development only. | ||
| # Do NOT use these credentials in production. | ||
| # The auth compose overlay provides sample defaults, but for any real deployment | ||
| # you should create a `.env` file with secure values and override defaults. | ||
|
|
||
| # LDAP sample values | ||
| LDAP_ORGANISATION=Acme | ||
| LDAP_DOMAIN=acme.org | ||
| LDAP_ADMIN_PASSWORD=changeme-ldap-admin-pw-123 | ||
| LDAP_CONFIG_PASSWORD=changeme-ldap-config-pw-123 | ||
| LDAP_READONLY_USER=true | ||
| LDAP_READONLY_USER_USERNAME=svc_mapstore_ldap | ||
| LDAP_READONLY_PASSWORD=changeme-ldap-bind-pw-123 | ||
| LDAP_TLS=false | ||
|
|
||
| # Keycloak dev admin (admin console at http://localhost/keycloak/admin/) | ||
| KEYCLOAK_ADMIN=admin | ||
| KEYCLOAK_ADMIN_PASSWORD=changeme-keycloak-admin-pw-123 | ||
| KEYCLOAK_HTTP_RELATIVE_PATH=/keycloak | ||
| KEYCLOAK_HOSTNAME=http://localhost/keycloak | ||
| KEYCLOAK_HOSTNAME_STRICT=false | ||
| KEYCLOAK_PROXY_HEADERS=xforwarded | ||
| KEYCLOAK_REALM_FILE=realm-mapstore.json | ||
| # The auth compose expects a realm file named `realm-mapstore.json` in `docker/keycloak/` by default. | ||
| # To use the shipped sample, copy `docker/keycloak/realm-mapstore.sample.json` to | ||
| # `docker/keycloak/realm-mapstore.json` or set `KEYCLOAK_REALM_FILE` to the sample filename. |
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,103 @@ | ||
| version: "3.8" | ||
| networks: | ||
| mapstore-network: | ||
| driver: bridge | ||
|
|
||
| services: | ||
| ldap: | ||
| build: | ||
| context: ./docker/openldap/ | ||
| image: geosolutions-mapstore/openldap | ||
| container_name: ldap | ||
| restart: on-failure | ||
| entrypoint: | ||
| - /bin/sh | ||
| - -lc | ||
| - > | ||
| rm -rf /container/service/slapd/assets/config/bootstrap/ldif/custom/* && | ||
| cp -R /ldif-src/. /container/service/slapd/assets/config/bootstrap/ldif/custom/ && | ||
| exec /container/tool/run | ||
| environment: | ||
| LDAP_ORGANISATION: "${LDAP_ORGANISATION:-Acme}" | ||
| LDAP_DOMAIN: "${LDAP_DOMAIN:-acme.org}" | ||
| LDAP_ADMIN_PASSWORD: "${LDAP_ADMIN_PASSWORD:-changeme-ldap-admin-pw-123}" | ||
| LDAP_CONFIG_PASSWORD: "${LDAP_CONFIG_PASSWORD:-changeme-ldap-config-pw-123}" | ||
| LDAP_READONLY_USER: "true" | ||
| LDAP_READONLY_USER_USERNAME: "${LDAP_READONLY_USER_USERNAME:-svc_mapstore_ldap}" | ||
| LDAP_READONLY_USER_PASSWORD: "${LDAP_READONLY_PASSWORD:-changeme-ldap-bind-pw-123}" | ||
| LDAP_TLS: "${LDAP_TLS:-false}" | ||
| volumes: | ||
| - ldap_data:/var/lib/ldap | ||
| - ldap_config:/etc/ldap/slapd.d | ||
| - ./docker/openldap/ldif:/ldif-src:ro | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "ldapsearch -x -H ldap://localhost -b \"\" -s base \"(objectClass=*)\" namingContexts >/dev/null 2>&1"] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 30 | ||
| start_period: 20s | ||
| networks: | ||
| - mapstore-network | ||
|
|
||
| keycloak: | ||
| image: quay.io/keycloak/keycloak:26.0.7 | ||
| container_name: keycloak | ||
| restart: on-failure | ||
| environment: | ||
| KC_BOOTSTRAP_ADMIN_USERNAME: "${KEYCLOAK_ADMIN:-admin}" | ||
| KC_BOOTSTRAP_ADMIN_PASSWORD: "${KEYCLOAK_ADMIN_PASSWORD}" | ||
| KC_HTTP_ENABLED: "true" | ||
| KC_HTTP_RELATIVE_PATH: "${KEYCLOAK_HTTP_RELATIVE_PATH:-/keycloak}" | ||
| KC_HOSTNAME: "${KEYCLOAK_HOSTNAME:-http://localhost/keycloak}" | ||
| KC_HOSTNAME_STRICT: "${KEYCLOAK_HOSTNAME_STRICT:-false}" | ||
| KC_PROXY_HEADERS: "${KEYCLOAK_PROXY_HEADERS:-xforwarded}" | ||
| KC_HEALTH_ENABLED: "true" | ||
| KC_HTTP_MANAGEMENT_RELATIVE_PATH: / | ||
| command: start-dev --import-realm | ||
| volumes: | ||
| - ./docker/keycloak/realm-mapstore.json:/opt/keycloak/data/import/realm-mapstore.json:ro | ||
| - keycloak_data:/opt/keycloak/data | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "{ printf 'HEAD /health/ready HTTP/1.0\\r\\n\\r\\n' >&0; grep 'HTTP/1.0 200'; } 0<>/dev/tcp/127.0.0.1/9000"] | ||
| interval: 5s | ||
| timeout: 3s | ||
| retries: 12 | ||
| start_period: 30s | ||
| networks: | ||
| - mapstore-network | ||
|
|
||
| proxy: | ||
| image: nginx | ||
| container_name: proxy | ||
| volumes: | ||
| - ./docker/mapstore.auth.conf:/etc/nginx/conf.d/default.conf:rw | ||
| ports: | ||
| - 80:80 | ||
| depends_on: | ||
| - mapstore | ||
| - keycloak | ||
| networks: | ||
| - mapstore-network | ||
|
|
||
| mapstore: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| args: | ||
| MAPSTORE_WEBAPP_SRC: "mapstore.war" | ||
| depends_on: | ||
| ldap: | ||
| condition: service_healthy | ||
| keycloak: | ||
| condition: service_healthy | ||
| extra_hosts: | ||
| - "host.docker.internal:host-gateway" | ||
| volumes: | ||
| - "${DATADIR_PATH:-./datadir}:/usr/local/tomcat/datadir:ro" | ||
| networks: | ||
| - mapstore-network | ||
|
|
||
| volumes: | ||
| ldap_data: | ||
| ldap_config: | ||
| keycloak_data: |
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,102 @@ | ||
| { | ||
| "realm": "mapstore", | ||
| "enabled": true, | ||
| "registrationAllowed": false, | ||
| "loginWithEmailAllowed": true, | ||
| "duplicateEmailsAllowed": false, | ||
| "resetPasswordAllowed": false, | ||
| "editUsernameAllowed": false, | ||
| "sslRequired": "external", | ||
| "roles": { | ||
| "realm": [ | ||
| { | ||
| "name": "admin", | ||
| "description": "Mapped to MapStore ADMIN (see mapstore-ovr.properties roleMappings)" | ||
| }, | ||
| { | ||
| "name": "user", | ||
| "description": "Optional; default MapStore role is USER if unmapped" | ||
| } | ||
| ] | ||
| }, | ||
| "groups": [ | ||
| { | ||
| "name": "kc-admins", | ||
| "path": "/kc-admins" | ||
| }, | ||
| { | ||
| "name": "kc-users", | ||
| "path": "/kc-users" | ||
| } | ||
| ], | ||
| "users": [ | ||
| { | ||
| "username": "kcuser", | ||
| "enabled": true, | ||
| "emailVerified": true, | ||
| "firstName": "Keycloak", | ||
| "lastName": "User", | ||
| "email": "kcuser@acme.org", | ||
| "realmRoles": ["user"], | ||
| "groups": ["/kc-users"], | ||
| "credentials": [ | ||
| { | ||
| "type": "password", | ||
| "value": "changeme-kcuser-pw-123", | ||
| "temporary": false | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "username": "kcadmin", | ||
| "enabled": true, | ||
| "emailVerified": true, | ||
| "firstName": "Keycloak", | ||
| "lastName": "Admin", | ||
| "email": "kcadmin@acme.org", | ||
| "realmRoles": ["admin"], | ||
| "groups": ["/kc-admins"], | ||
| "credentials": [ | ||
| { | ||
| "type": "password", | ||
| "value": "changeme-kcadmin-pw-123", | ||
| "temporary": false | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "clients": [ | ||
| { | ||
| "clientId": "mapstore-server", | ||
| "name": "MapStore OpenID (server)", | ||
| "enabled": true, | ||
| "protocol": "openid-connect", | ||
| "publicClient": false, | ||
| "clientAuthenticatorType": "client-secret", | ||
| "secret": "changeme-mapstore-oidc-client-secret-123", | ||
| "standardFlowEnabled": true, | ||
| "directAccessGrantsEnabled": false, | ||
| "serviceAccountsEnabled": false, | ||
| "redirectUris": ["http://localhost/mapstore/*"], | ||
| "webOrigins": ["http://localhost", "+"], | ||
| "protocolMappers": [ | ||
| { | ||
| "name": "groups", | ||
| "protocol": "openid-connect", | ||
| "protocolMapper": "oidc-group-membership-mapper", | ||
| "consentRequired": false, | ||
| "config": { | ||
| "claim.name": "groups", | ||
| "full.path": "false", | ||
| "id.token.claim": "true", | ||
| "access.token.claim": "true", | ||
| "userinfo.token.claim": "true" | ||
| } | ||
| } | ||
| ], | ||
| "attributes": { | ||
| "post.logout.redirect.uris": "http://localhost/mapstore/*" | ||
| } | ||
| } | ||
| ] | ||
| } |
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.