diff --git a/examples/basic/.env.example b/examples/basic/.env.example new file mode 100644 index 0000000..f1a4fba --- /dev/null +++ b/examples/basic/.env.example @@ -0,0 +1,5 @@ +CLIENT_ID= +CLIENT_SECRET= + +APP_URL= +ISSUER_URI= \ No newline at end of file diff --git a/examples/basic/.gitignore b/examples/basic/.gitignore new file mode 100644 index 0000000..952ff17 --- /dev/null +++ b/examples/basic/.gitignore @@ -0,0 +1,4 @@ +.env +keycloak_example/keycloak_data/* +!keycloak_example/keycloak_data/keep +.idea \ No newline at end of file diff --git a/examples/basic/README.md b/examples/basic/README.md new file mode 100644 index 0000000..528e199 --- /dev/null +++ b/examples/basic/README.md @@ -0,0 +1,19 @@ +# Example OIDC Setup + +This is an exmple using Keycloak as the OIDC provider. + +Steps for statring the service and adding an account: +- starting keycloak: `docker-compose -f keycloak/docker-compose.yml up` +- create a new realm in keycloak +- create a new client in the realm +- add an account in the realm +- set the accounts password under credentials tab + +Steps for attaching the application to the OIDC provider: +- copy the `.env.example` file to `.env` +- generate your issuers IP (localhost in this case): `hostname -I | awk '{print $1}'` (THIS MAY CHANGE DEPENDING ON YOUR NETWORK) +- set the `ISSUER` in the `.env` file to the IP +- set the `CLIENT_ID` in the `.env` file to the client id of the client you created in keycloak +- set the `CLIENT_SECRET` in the `.env` file to the client secret of the client you created in keycloak + + diff --git a/examples/basic/keycloak_example/compose.yml b/examples/basic/keycloak_example/compose.yml new file mode 100644 index 0000000..fd94d86 --- /dev/null +++ b/examples/basic/keycloak_example/compose.yml @@ -0,0 +1,15 @@ +version: '3.8' + +services: + # THIS SETUP IS PNLY FOR TESTING PRUPOSES, PLEASE DO NOT USE IT IN PRODUCTION + keycloak: + image: quay.io/keycloak/keycloak:19.0.2 + command: start-dev + ports: + - "8989:8080" + environment: + - KEYCLOAK_ADMIN=admin + - KEYCLOAK_ADMIN_PASSWORD=admin + user: "${UID}:${GID}" + volumes: + - ./keycloak_data:/opt/keycloak/data/h2/:z diff --git a/examples/basic/keycloak_example/keycloak_data/keep b/examples/basic/keycloak_example/keycloak_data/keep new file mode 100644 index 0000000..e69de29