Skip to content

Firebase JWT Validate token on ALB

0

I was trying out jwt validate token feature on aws alb from this post https://aws.amazon.com/about-aws/whats-new/2025/11/application-load-balancer-jwt-verification/ But i seem unable to get it to work consistently. I set JWKS endpoint points to googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com, and the issuer is set to https://securetoken.google.com/{project-id}, then pass the id token in Authorization header to the api url. But i seem to get JWTValidationInternalError or JWKSRequestFailed often. It just doesn't seem to give a consistent response.

asked 9 months ago285 views

2 Answers
0

AWS Application Load Balancer (ALB) JWT verification relies on both a stable JWKS endpoint and precise issuer configuration. The intermittent errors you are encountering (such as JWTValidationInternalError or JWKSRequestFailed) typically occur when the JWKS endpoint is not consistently accessible or when the token’s issuer claim does not exactly align with the issuer value configured on the ALB. According to the official AWS documentation, ALB performs JWT validation by retrieving keys from the specified JWKS URI and enforces strict matching of the iss claim to ensure compliance.

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/listener-verify-jwt.html

https://aws.amazon.com/about-aws/whats-new/2025/11/application-load-balancer-jwt-verification/

https://firebase.google.com/docs/auth/admin/verify-id-tokens

EXPERT

answered 9 months ago

  • Seems like this new feature is buggy then.

0

This is almost always JWKS fetch instability, not token issues. ALB retrieves the JWKS at request time and fails if the Google JWKS endpoint is slow, unreachable, or times out, causing JWKSRequestFailed or JWTValidationInternalError. The reliable fix is to front Google’s JWKS with a cached endpoint you control (API Gateway/Lambda or CloudFront) and point ALB to that URL. Also ensure the ALB has outbound internet access, the issuer matches exactly, and the header is Authorization: Bearer <id_token>.

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.