Thank you @jangaraj
Described use case is exactly what we are going to achieve.
Please check my understanding and help with steps to reproduce:
-
Frontend gets own TOKEN by calling demo realm
https://keycloak.com/auth/realms/demo/protocol/openid-connect/tokenwith client id and secret. -
Frontend calls backend with header
--header "Authorization: Bearer $TOKEN"
Using curl
Get TOKEN:
TOKEN=$(curl -s -d "client_secret=xxxxx" -d "client_id=type=client_credentials" "https://keycloak/auth/realms/demo/protocol/openid-connect/token" | jq -r ".access_token"); echo $TOKEN
Access application:
curl -X GET -kL https://demo.app/ --header "Authorization: Bearer $TOKEN"
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 Gatekeeper keycloak-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.
grep -R -i -n jwk *
e2e_test.go:105: "jwks_uri":"http://`+e2eOauthListener+`/auth/realms/master/protocol/openid-connect/certs"
oauth_test.go:40: key jose.JWK
oauth_test.go:82: JwksURI string `json:"jwks_uri"`
oauth_test.go:103: key: jose.JWK{
oauth_test.go:162: JwksURI: fmt.Sprintf("http://%s/auth/realms/hod-test/protocol/openid-connect/certs", r.location.Host),
oauth_test.go:176: renderJSON(http.StatusOK, w, req, jose.JWKSet{Keys: []jose.JWK{r.key}})
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