XIVAuth makes use of JWTs for purposes of attestations, such as proving ownership over a character. The JWT implementation that XIVAuth exposes requires some special considerations in order to keep consumer applications secure. This page documents those considerations, as well as general guidance for ensuring safety while using Attestation JWTs.
<aside> 🔥 This document is still being written, and serves as loose notes right now.
</aside>
kid
field in their header to denote which key signed the JWT. Consumers will need to use this kid
to find the public key as exposed by JWKS.Ed25519
JWTs, be sure you’re only verifying Ed25519
as an algorithm type!
/verify
endpoint will have this taken care of for them. XIVAuth will find the kid
that generated the key and verify that the algorithm used is allowed for that kid
. That is, a kid
that refers to an RSA-only key will only verify against the RSA algorithms.kid
instead, and verify your signature types appropriately.
kid
will never have HS
as a supported algorithm in order to prevent algorithm confusion vulnerabilities.HS256
et al), the /verify
endpoint is mandatory as key material is not released.XIVAuth JWT attestations are normal (mostly-standards-compliant) JWTs, with the following properties in the header:
kid
field will always be set with the name of the key that signed that JWT.typ
field is the type name of the object included in the attestation. This does not follow a standard Media Type, so clients should take care to verify.
typ
of Character
.jku
field will point to the URL of the JWKS endpoint on XIVAuth. Note that this value is intended to be informational only; any actual checks should be against a hardcoded endpoint.Likewise, certain properties are defined for bodies of attestation JWTs:
jti
field will be set to a randomly generated string. This value may be assumed to be unique.iss
field will contain the URL pointing to the XIVAuth server that issued the JWT.
https://xivauth.net/
.aud
field, set to the value https://xivauth.net/applications/{application_id}
.
iat
and exp
field will always be present in the JWT body, with a low TTL for expiration. Clients should not implement any skew for these fields.For security and interop purposes, XIVAuth will also include an optional nonce
field in the JWT body. The contents of this field are controlled by the requesting client, and are considered opaque to XIVAuth. API clients are generally advised to set this to a random value to prevent token replay attacks, but clients may choose to send state information if desired.