Skip to content

Private Key JWT reference

Overview

This reference guide covers the technical details of Private Key JWT authentication for OAuth clients in Qlik Cloud. For a step-by-step tutorial, see Authenticate with Private Key JWT.

Private Key JWT allows OAuth applications to authenticate using asymmetric cryptography (public/private key pairs) instead of shared secrets.

Supported algorithms

Qlik Cloud accepts public keys using the following signing algorithms:

AlgorithmKey TypeMin Key SizeDescription
RS256RSA2048 bitsRSASSA-PKCS1-v1_5 with SHA-256
RS512RSA2048 bitsRSASSA-PKCS1-v1_5 with SHA-512
ES384ECN/AECDSA with P-384 curve and SHA-384
Warning

RSA keys must be at least 2048 bits. For long-term production keys, 4096 bits is recommended.

JWT assertion structure

When your application requests a token, it creates a JWT assertion with the following structure.

JWT claims

ClaimValueRequirementNotes
iss (issuer)Your OAuth client IDRequiredMust match the client ID registered in Qlik Cloud.
sub (subject)Your OAuth client IDRequiredMust match the iss claim.
aud (audience)https://<TENANT>.qlikcloud.com/oauth/tokenRequiredMust match your tenant token endpoint. A trailing slash is accepted.
iat (issued at)Unix timestampRequiredWhen the assertion was issued (seconds since epoch). Must not be in the future.
exp (expiration)Unix timestampRequiredWhen the assertion expires. exp minus iat must not exceed 3600 seconds.
jti (JWT ID)Universally unique identifier (UUID)OptionalNot required or validated by Qlik Cloud. The examples generate a new UUID for each assertion.

JWT headers

HeaderValueRequirementNotes
algRS256, RS512, or ES384RequiredMust match the alg of the public JWK registered with the OAuth client.
kidKey IDRequiredMust match the kid of the public JWK registered with the OAuth client.
Note

If kid is missing, or if no registered JWK matches both the kid and the alg in the assertion header, the token request fails with 401 Unauthorized and the error detail No matching public key found.

Example JWT header

{
"alg": "RS256",
"kid": "my-key-1"
}

Example JWT payload

{
"iss": "my-oauth-client-id",
"sub": "my-oauth-client-id",
"aud": "https://my-tenant.qlikcloud.com/oauth/token",
"jti": "550e8400-e29b-41d4-a716-446655440000",
"iat": 1712525123,
"exp": 1712525423
}

JSON Web Key (JWK) format

Register your public key in JWK format with your OAuth client. The JWK must include the signing algorithm and usage metadata.

JWK field reference

FieldRSAECRequiredDescription
kidKey IDKey IDYesIdentifier for the public key. Use the same value in the JWT assertion header.
ktyRSAECYesKey type: "RSA" or "EC"
algRS256, RS512ES384YesSigning algorithm. Must match the alg in the JWT assertion header.
e✓—Yes (RSA)RSA exponent (typically "AQAB")
usesigsigYesKey usage: must be "sig" (signing)
n✓—Yes (RSA)RSA modulus (base64url-encoded)
crv—✓Yes (EC)Elliptic curve: For ES384, use "P-384"
x—✓Yes (EC)EC X coordinate (base64url-encoded)
y—✓Yes (EC)EC Y coordinate (base64url-encoded)

RSA example (RS256)

{
"kid": "my-key-1",
"kty": "RSA",
"alg": "RS256",
"e": "AQAB",
"use": "sig",
"n": "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw"
}

EC example (ES384)

{
"kid": "my-ec-key-1",
"kty": "EC",
"alg": "ES384",
"crv": "P-384",
"use": "sig",
"x": "gI0GAILBdu7-ViNS8tBj...",
"y": "SLrelm8_SWcV8uAPAVLV..."
}
Was this page helpful?