Skip to content

Commit

Permalink
ISPN-15359 Fixes Keycloak integration in the console
Browse files Browse the repository at this point in the history
  • Loading branch information
karesti committed Dec 5, 2023
1 parent 9d9b9b0 commit b9159da
Show file tree
Hide file tree
Showing 14 changed files with 1,978 additions and 115 deletions.
26 changes: 6 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,12 @@ If you run a server without any user or password, the 'Support' popup should be

### Keycloak

1. `docker run -p 8080:8080 -e KEYCLOAK_USER=keycloak -e KEYCLOAK_PASSWORD=keycloak --name keycloak jboss/keycloak:12.0.2`
2. Connect to `http://localhost:8080` to access the Keycloak admin console.
3. Select `Add realm` and then upload `data/infinispan-keycloak-realm.json`.
4. Create an Infinispan server configuration with the following security realm:
1. Add an alias between 127.0.0.1 keycloak in the 'etc/hosts' file.
2. Run the Docker compose file under the folder 'keycloak'. It will spin up an Infinispan Server with keycloak realm and Keycloak server.

```xml
<security>
<security-realms>
<security-realm name="default">
<token-realm name="infinispan" auth-server-url="http://localhost:8080/auth/" client-id="infinispan-console">
<oauth2-introspection
introspection-url="http://localhost:8080/auth/realms/infinispan/protocol/openid-connect/token/introspect"
client-id="infinispan-server" client-secret="1fdca4ec-c416-47e0-867a-3d471af7050f"/>
</token-realm>
</security-realm>
</security-realms>
</security>
```shell
docker-compose up
```

You can also copy the security realm from `data/infinispan-security-realm.xml`.

4. Run the console in dev mode. When you open the dev console in your browser, Keycloak prompts you for credentials.
5. Enter the `admin/adminPassword` credentials. Keycloak redirects you to the dev console.
3. Run the console in dev mode. When you open the dev console in your browser, Keycloak prompts you for credentials.
4. Enter the `admin/adminPassword` credentials. Keycloak redirects you to the dev console.
34 changes: 34 additions & 0 deletions keycloak/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3'

networks:
mynetwork:
driver: bridge
services:
infinispan-server:
image: quay.io/infinispan/server:15.0
volumes:
- ${PWD}:/user-config
depends_on:
- "keycloak"
ports:
- "11222:11222"
container_name: ispn
environment:
USER: admin
PASS: password
networks:
- mynetwork
command: -c infinispan.xml -c /user-config/infinispan-token-realm.yaml
keycloak:
image: quay.io/keycloak/keycloak
volumes:
- ${PWD}/infinispan-keycloak-realm.json:/opt/keycloak/data/import/infinispan-keycloak-realm.json
ports:
- "8080:8080"
container_name: keycloak
environment:
KEYCLOAK_ADMIN: keycloak
KEYCLOAK_ADMIN_PASSWORD: keycloak
command: ['start-dev', '--import-realm']
networks:
- mynetwork
Loading

0 comments on commit b9159da

Please sign in to comment.