As per documentation Keycloak gatekeeper supports bearer token for authentication. After deployment https://hub.helm.sh/charts/gabibbo97/keycloak-gatekeeper it seems that only browser cookie works. But in tcpdump from upstream application I can see x-auth-token details which are not visible in browser.
Please elaborate how can I use Bearer token(not cookie) in order to authentication as client e.g. using curl curl -v http://$INGRESS_HOST --header "Authorization: Bearer $TOKEN"
Keycloak Gatekeeper is an adapter which integrates with the Keycloak authentication service supporting both access tokens in browser cookie or bearer token
Browser cookie works, because you are using it in the browser. Nothing stops you to generate TOKEN outside of Gatekeeper and then use it the request to Gatekeeper protected endpoint.
Typical use case:
frontend (Angular, React) uses implicit flow and it gets own TOKEN
frontend uses this TOKEN for backend requests (backend is protected by Gatekeeper, which only verifies TOKEN validity)
Of course frontent/backend needs to use the same OIDC client + properly configured Gatekeeper (e.g. symetric token encryption should be disabled, …)
Curl provides keycloak login page instead of demo application page. I’m confused here
Also by meaning disable symetric token encryption I understand you are asking to change Client Authenticator in Keycloak from Client ID and Secret to Signed JWT or X509.
The probelm with changing symetric authentication type is that I didn’t find any documentation reference how to use Signed JWT in Keycloak Gatekeeperkeycloak-gatekeeper 4.0.0 · helm/gabibbo97
I can see some reference in keycloak gatekeeper for JWKS in oauth_test.go and e2e_test.go files, but not sure this could be used in configuration somehow.
Here are my another questions posted related to how Signed JWT in Keycloak, in simply world, when I change Client Authenticator in Keycloak to Signed JWT I receive 403 error from browser after login via keycloak gatekeeper. Probably because keycloak gatekeeper is configured with client id and secret
I wonder if there is any guide or at least reference how to use JWKS URL in Keycloak , specially with keycloak gatekeeper
This is client credential flow - it is designated for machine to machine communication. SPA should use implicit flow (or better Authorization Code with PKCE Flow).
Check the gatekeeper debug logs to see reason, why call is redirected to the login.
Symmetric encryption is on Gatekeeper level:
--enable-encrypted-token enable encryption for the access tokens (default: false)
Signed JWT is not supported by Gatekeeper. JWKS URL is discovered trough OIDC discovery and it is used to verify token signatures.