diff --git a/README.md b/README.md index 88650dc6489ed9d9e0abd37846777e88453debe3..885764e45eccbdd36a271e95a8bc480cbbed6af9 100644 --- a/README.md +++ b/README.md @@ -128,20 +128,20 @@ the `root` token. ### Keycloak -Keycloak is used for client authentication. Keycloak server runs in development mode and contains -preconfigured client ID and secret. The Keycloak server is available at `localhost:8086` on the host machine or +Keycloak is used for service-to-service authentication. Keycloak server runs in development mode and contains +preconfigured `client_id` and `client_secret` for every service. It is available at `localhost:8500` on the host machine or at `http://keycloak:8080` inside the docker-compose network. Example request for JWT token acquire: ```shell -curl --location --request POST 'localhost:8086/realms/workspace/protocol/openid-connect/token' \ +curl --location --request POST 'localhost:8500/realms/workspace/protocol/openid-connect/token' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'client_id=workspace' \ --data-urlencode 'grant_type=client_credentials' \ --data-urlencode 'client_secret=79bdTGYCKLz9wYSY61vpQF5d4CyZBpsZ' ``` -Example JWKS URL for acquiring public keys for validating tokens: `localhost:8086/realms/workspace/protocol/openid-connect/certs` +Example JWKS URL for acquiring public keys for validating tokens: `localhost:8500/realms/workspace/protocol/openid-connect/certs` ### License diff --git a/docker-compose.yml b/docker-compose.yml index cd1d93550c1633fdca8749fe02b16ebdb2da682a..8a04c883c435e00267270158324d85098ecb1c8b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -216,12 +216,12 @@ services: - --import-realm - --health-enabled=true volumes: - - ./keycloak:/opt/keycloak/data/import/ + - ./keycloak/config.json:/opt/keycloak/data/import/config.json healthcheck: test: [ "CMD-SHELL", "curl -f localhost:8080/health || exit 1" ] interval: 3s timeout: 2s - retries: 5 - start_period: 10s + retries: 10 + start_period: 5s ports: - - "8086:8080" + - "8500:8080" diff --git a/keycloak/config.json b/keycloak/config.json index bf632c2d03cebf84579366e770292bfa079a231b..7feaef64fa9c1f5d467a31e03983889aa75c6370 100755 --- a/keycloak/config.json +++ b/keycloak/config.json @@ -599,15 +599,15 @@ }, { "id" : "3bf9b7e9-cb9d-408c-97e0-1a22f9c6ac53", "clientId" : "workspace", - "rootUrl" : "http://localhost:8086/", - "adminUrl" : "http://localhost:8086/", + "rootUrl" : "http://localhost:8500/", + "adminUrl" : "http://localhost:8500/", "surrogateAuthRequired" : false, "enabled" : true, "alwaysDisplayInConsole" : false, "clientAuthenticatorType" : "client-secret", "secret" : "79bdTGYCKLz9wYSY61vpQF5d4CyZBpsZ", - "redirectUris" : [ "http://localhost:8086/*" ], - "webOrigins" : [ "http://localhost:8086" ], + "redirectUris" : [ "http://localhost:8500/*" ], + "webOrigins" : [ "http://localhost:8500" ], "notBefore" : 0, "bearerOnly" : false, "consentRequired" : false,