Note: Parsing and validation of the JWS should happen only in your backend. Doing the parsing on the client side defeats the purpose of our digital signature
JWS structure
The result is a string representing a JWS Compact Serialization, a representation of the JWS as a compact, URL-safe string, see https://tools.ietf.org/html/rfc7515 for details. The decoded JWS is composed of a header that defines the algorithm and the token type and the payload that contains the data.
The “kid” attribute contains the key identifier that is needed to retrieve the public key to validate the JWS signature, see JWS validation and parsing for details.
Note: Parsing and validation of the JWS should happen only in your backend. Doing the parsing on the client side defeats the purpose of our digital signature
The JWS can be validated using the list of public keys available on https://id.uqudo.io/api/.well-known/jwks.json. It is a public endpoint:
The kid in the JWS header is used to identify the key in the list above.
Note: Check https://jwt.io/libraries for the best library you can use according to your environment and programming language. Make sure the libary you choose supports JWKs through URL and make sure it caches the list of keys in memory and refresh the cache only if the kid is not found.
Below you can find an example on how to parse and validate the JWS using io.jsonwebtoken: