Dynamically construct `jwk_set_url` by using kid as part of the URL
#109,373 创建于 2025年8月8日
描述
Why is this needed:
Opening ticket based on prior discussion
I'm using Grafana behind AWS load-balancer, which is responsible for authentication and is then providing a JWT in the request header to Grafana. However, I can't configure the JWT auth due to Grafana requiring statically configured jwk_set_url, which is not possible in this case, since AWS load-balancer has a different URL for each key, as explained in the documentation.
What would you like to be added:
I'd like to be able to either reference some key in jwk_set_url or use a different config value to use a different url based on the kid, like jwk_url_format
[auth.jwt]
enabled = true
header_name = x-amzn-oidc-data
username_claim = sub
email_claim = email
jwk_set_url = https://public-keys.auth.elb.eu-west-1.amazonaws.com/{{kid}}/.well-known/jwks.json
# or
jwk_url_format = https://public-keys.auth.elb.eu-west-1.amazonaws.com/{{kid}}
Who is this feature for?
This feature is for people either using AWS load balancer for auth, or comparable JWT proxies which don't have one nice jwk_set_url.