Authorization code (JWT format)
The authorization code is a JSON Web Token (JWT) generated by the issuer. It follows the RFC 7519 specification and provides identity and integrity protection for the TSH server.
JWT is widely used to manage authorization and propagate identity. For implementations, see the libraries listed on jwt.io.
A JSON Web Token has three parts: header, claims, and signature. Each part is a JSON object that is base64url-encoded.
Part 1: the header
The header defines the signing algorithm used for the token.
These are the supported fields and values:
typ
static value 'JWT'
alg
'RS256' where RSA 2048 is used for signature computation and SHA256 for hashing.
kid
Identifier of the key used for the signature of the JWT. It is shared during the onboarding process between the issuer and TSH server. RFU for the management of key rotation. Value which is basically can be whatever value you want, as long as it uniquely identify your key. Can be thumbprint, random ...
Example:
// S{ "typ": "JWT", "alg": "RS256" }{ "typ": "JWT", "alg": "RS256" }
header (in base64) is:
eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9
Part 2: the claims
The authorization code contains claims about the authenticated user. It also defines the token validity period. These are the supported claim fields and values:
iss
The issuerId value provided during the onboarding process.
sub
It shall be either the issuerCardRefId value (already provided in JWE payload) that identifies the authorized PAN for push provisioning request or the tokenId for LCM operation.
aud
The ‘audience’ is the token requestor, so the tokenRequestorId is provided in this field. values as: GOOGLE_PAY / APPLE_PAY / SAMSUNG_PAY
exp
The JWT expiration date, date format is defined in the RFC 7519 specification. Recommended maximum value is current date/time + 5 minutes.
iat
The time at which the JWT was issued.
jti
The JWT's unique identifier. This is an optional field but if set it MUST be unique for each request.
Part 3: the signature
The signature is computed using RSA-2048 and SHA-256 over the concatenated header and claims, using the issuer private key PRIVATE_KEY. The TSH server validates the signature using the certificate provided by the issuer during the onboarding process.
The following Node.js example shows how to generate a JWT:
Authorization code example:
Last updated
Was this helpful?