This example repo describe how to access httpbin/any service securely via kong OIDC with keycloak.
-
Build the kong using
docker-compose build kong
-
Then
docker-compose up -d
-
Then visit http://localhost:8000
-
Login using username: admin, password: admin
-
Now the httpbin page will load
-
To logout http://localhost:8000/auth/realms/master/protocol/openid-connect/logout?redirect_uri=http%3A%2F%2Flocalhost%3A8000 then http://localhost:8000/logout
Load the keycloak config into the keycloak using their API. We used this only to create clients. But you can use this for load all kind of keycloak config. Export keycloak config and use it here.
This is just a shell script with curl command against kong admin API.
This will create
-
Service
-
Routes
-
Plugins
These are the following things are minimum requirement to deploy this stack in production.
-
Keycloak theme based on organization
-
Import existing LDAP/AD users using keycloak user federation
-
Keycloak external identity provider
-
Keycloak proper user and role mapping
-
Define authentication flow based on need
-
Integrate monitoring and alerting system like prometheus and grafana
To handle the load
-
Run keycloak as cluster
-
Run postgres as cluster
-
Run kong as cluster