API / APIGEE Gateway Interview Questions
How does JWT validation work in Apigee?
Apigee provides a dedicated JWT policy (separate from OAuthV2) for validating, generating, and decoding JSON Web Tokens. The JWT policy is useful when your authentication scheme uses JWTs issued by an external identity provider such as Google Identity, Auth0, Okta, or Keycloak.
<!-- VerifyJWT: validate a JWT from the Authorization header --> <JWT name="JWT.Verify"> <Operation>VerifyJWT</Operation> <Source>request.header.authorization</Source> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <!-- Validate signature using a public key stored in KVM --> <PublicKey> <JWKS ref="kvm.jwks.endpoint"/> <!-- Or use a static PEM: <Value ref="kvm.jwt.public-key"/> --> </PublicKey> <!-- Optional claims validation --> <Issuer>https://auth.example.com</Issuer> <Audience>https://api.example.com</Audience> <!-- AdditionalClaims can validate custom claims --> <AdditionalClaims> <Claim name="role" type="string">admin</Claim> </AdditionalClaims> </JWT> <!-- After successful VerifyJWT, claims are available as flow variables: jwt.JWT.Verify.claim.sub -- subject jwt.JWT.Verify.claim.email jwt.JWT.Verify.claim.role jwt.JWT.Verify.claim.exp -- expiry epoch jwt.JWT.Verify.valid -- true/false --> <!-- GenerateJWT: create a JWT for backend (service account flow) --> <JWT name="JWT.Generate"> <Operation>GenerateJWT</Operation> <ExpiresIn>3600</ExpiresIn> <Subject>apigee-proxy</Subject> <Issuer>https://api.example.com</Issuer> <SecretKey> <Value ref="kvm.jwt.signing-secret"/> </SecretKey> </JWT>
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
