JWT validation pattern with `jku` and `kid` claims
See original GitHub issueHi @nenaraab,
In SAP Cloud SDK, we’re integrating your library to handle XSUAA authentication topics. Currently, we’re fixing JWT validation that fails because of this change: tenant specific JWT signing keys
In regard to this, I have a couple of questions to ensure our implementation is secure and compliant:
- How do you ensure
jku
is from a whitelisted domain? Should we ensure it on Cloud SDK side? - As I understood from the sources you consider
jku
trusted after ensuring that issue is trusted by checkingiss
? - Does XSUAA always provide
jku
andkid
to fetch the public key for token validation? Or it can also be onlyjku
? - If a mocked or testing server is used to issue
JWT
how can we provide a URL of this issuer to make validation work for running tests locally or other use cases requiring to override XSUAA as s token issuer?
Thank you in advance for your help! I hope this makes sense. cc @MatKuhr @newtork
Best, Artem
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
JSON web token (JWT) validation
You have two options to validate JWT. You can provide the URL. The API Gateway will then ignore existence of JKU claim (it...
Read more >Hacking JWT Tokens: jku Claim Misuse | by Shivam Bathla
JSON Web Token (JWT) is a means of representing claims to be transferred ... Objective: (Ab)use the jku claim to retrieve the Golden...
Read more >JWTs? JWKs? 'kid's? 'x5t's? Oh my!
JWTs essentially encode any sets of identity claims into a payload, ... and the certificate to use to validate JWT will simply be...
Read more >Lab: JWT authentication bypass via jku header injection
This lab uses a JWT-based mechanism for handling sessions. The server supports the jku parameter in the JWT header. However, it fails to...
Read more >JWT: The Complete Guide to JSON Web Tokens
A JSON Web Token (or JWT) is simply a JSON payload containing a particular claim. The key property of JWTs is that in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
cool. Perfect and good migration idea 😃
Thanks, that would actually be great.
We currently use the library like this:
In case this validation fails we fall back to our “old” implementation and try again. That way our own mocking still works and nothing can break for the consumer.
So far one of our consumers confirmed that this works. Next steps would probably be leveraging the mocking capabilites of the XSUAA lib to better test this and also to deprecate our custom implementation.