JWT (15.12.2022 3M) Flashcards
JWT standard number
rfc7519
What is JWT abstractly?
JSON Web Token (JWT) is a compact claims representation format
intended for space-constrained environments such as HTTP Authorization headers and URI query parameters. Used to transfer claims between two parties.
The claims in a JWT are encoded as a JavaScript Object Notation (JSON).
JWT must be JWS or JWE.
JWS enables the claims to be digitally signed or integrity protected with a Message Authentication Code (MAC).
JWE enables the claims to be encrypted.
What is JWT by definition of rfc7519?
A string representing a set of claims as a JSON object that is encoded in encoded JWS or JWE, enabling the claims to be digitally signed or MACed and/or encrypted.
What is JWT Claim Set by definition of rfc7519?
A JSON object that contains the claims conveyed by the JWT.
What is Claim by definition of rfc7519?
A piece of information asserted about a subject. A claim is represented as a name/value pair consisting of a Claim Name and a Claim Value.
Claim Name - The name portion of a claim representation. A Claim Name is always a string.
Claim Value - The value portion of a claim representation. A Claim Value can be any JSON value.
What is Nested JWT?
The idea behind nested JWT is you create the JWT from JWT Claims Set first using JWS or JWE. And then use the resulting JWT and create another JWT using JWS or JWE.
While it’s technically possible to perform the operations in any order to create a nested JWT. A more common approach is to create JWS from JWT Claims Set and then create JWE from the resulting JWS.
If JWT is carrying Nested JWT, “cty” parameter of JOSE must have the value “JWT”
What is StringOrURI by definition of rfc7519? How values of this type are compared?
A JSON string value, with the additional requirement, that while arbitrary string values MAY be used, any value containing a “:”
character MUST be a URI. StringOrURI values are compared as case-sensitive strings with no transformations or canonicalizations applied.
What is NumericDate by definition of rfc7519?
A JSON numeric value representing the number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date/time, ignoring leap seconds.
How many claims can Claim Set contain?
Zero or more
What does JOSE stand for?
JOSE (Javascript Object Signing And Encryption) is a header used in JWT. This is not HTTP header, but just the first part of JWT string. It looks like a JSON object. For example {“typ”:”JWT”, “alg”:”HS256”}
It’s important to understand that JOSE header is part of JWS and JWE standards. Which are used as “container” for JWT.
The contents of the JOSE Header describe the cryptographic operations applied to the JWT and optionally, additional properties of the JWT.
If the JOSE Header is for a JWS, the JWT is represented as a JWS and the claims are digitally signed or MACed, with the JWT Claims Set being the JWS Payload.
If the JOSE Header is for a JWE, the JWT is represented as a JWE and the claims are encrypted, with the JWT Claims Set being the plaintext encrypted by the JWE.
How JWT is represented?
A JWT is represented as a sequence of URL-safe parts separated by period (‘.’) characters. Each part contains a base64url-encoded value. The number of parts in the JWT is dependent upon the representation of the resulting JWS using the JWS Compact Serialization or JWE using the JWE Compact Serialization.
How to manage JWT Claim Names duplication?
The Claim Names within a JWT Claims Set MUST be unique; JWT parsers MUST either reject JWTs with duplicate Claim Names or use a JSON parser that returns only the lexically last duplicate member name
What is the set of claims that a JWT must contain to be considered valid?
The set of claims that a JWT must contain to be considered valid is context-dependent and is outside the scope of this specification.
Specific applications of JWTs will require implementations to understand and process some claims in particular ways. However, in the absence of such requirements, all claims that are not understood by implementations MUST be ignored.
Name three classes of JWT Claim Names.
Registered Claim Names, Public Claim Names, and Private Claim Names.
What is Registered Claim Names class?
The Registered Claim Names are registered in the IANA “JSON Web Token Claims”.
None of the Registered Claim Names are intended to be mandatory to use or implement in all cases, but rather they provide a starting point for a set of useful, interoperable claims.
Applications using JWTs should define which specific claims they use and when they are required or optional.