3scale / APIcast

3scale API Gateway
Apache License 2.0
305 stars 171 forks source link

Dev environment: keycloak integration #1439

Closed eguzki closed 8 months ago

eguzki commented 8 months ago

What

New development environment to test integration between APIcast and Keycloak

Based on Keycloak 23.0.4

Note: The policy chain includes the token introspection policy, but this is not a requirement for testing keycloak integration.

Verification Steps

make runtime-image IMAGE_NAME=apicast-test
cd dev-environments/keycloak-env/
make gateway IMAGE_NAME=apicast-test
make keycloak-data

Admin web app available at http://127.0.0.1:9090, user: admin, pass: adminpass.

Access to the Keycloak CLI

docker compose -p keycloak-env exec keycloak /bin/bash      

Use the CLI

/opt/keycloak/bin/kcadm.sh --help                           
curl -v --resolve stg.example.com:8080:127.0.0.1 -H "Authorization: Bearer ${ACCESS_TOKEN}" "http://stg.example.com:8080"

The response should be HTTP/1.1 200 OK

eguzki commented 8 months ago

Just nitpicking but maybe we should remove unnecessary fields from the apicast-config.json file?

I copied it from a real 3scale API response body, then updated some fields with specific values for this dev env and cleaned up a bit not relevant sensitive field's values. I wanted to keep structure and fields to make sure integration works.

tkan145 commented 8 months ago

Not a big issue to me so feel free to merge when you are ready.