Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWT: support ALB token format #191

Open
CaerusKaru opened this issue Feb 28, 2024 · 5 comments
Open

JWT: support ALB token format #191

CaerusKaru opened this issue Feb 28, 2024 · 5 comments

Comments

@CaerusKaru
Copy link

AWS Application Load Balancers (ALB) are... special. While they are compliant with the OIDC specification, the resulting token doesn't follow the expected format. Instead of returning a JWT in the Authorization header, it returns it in the x-amzn-oidc-data header. And instead of publishing one consistent JWKS key set file, it publishes one per region, and returns the key ID (kid) as part of the payload of the token, to then be retrieved dynamically, on the fly[1].

So, the ask is two-fold:

  1. Support fetching the JWKS key set from a remote endpoint, instead of from a local file or inline value
  2. Support reading the JWT from a location other than the Authorization header
@EdSchouten
Copy link
Member

Support fetching the JWKS key set from a remote endpoint, instead of from a local file or inline value

I don't think we should support this. The reason being that it means services need to block on startup, waiting for fetching of the JWKS to complete. If the endpoint is unavailable for some odd reason, your service can't go live.

Please just write a Kubernetes cronjob that fetches the JWKS and stores it in a configmap.

@moroten
Copy link
Contributor

moroten commented Mar 17, 2024

https://stackoverflow.com/a/71662405 shoes how to update a ConfigMap from a pod.

@CaerusKaru
Copy link
Author

CaerusKaru commented Mar 17, 2024

We are not using k8s. We are using ECS. This option is not available to us.

Further, the JWKS fetch would not block service startup. As I said in the description, the fetch needs to happen dynamically per token, since the key value is embedded in it.

@EdSchouten
Copy link
Member

Then schedule a lambda or something. AWS must have some kind of facility to periodically fetch a URL and store it somewhere.

@CaerusKaru
Copy link
Author

The edit of the above comment is more important in the context here: the AWS JWKS endpoint is not static, it is dynamic, and (possibly) changes with each token passed, but can be cached after request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants