Tokens
Session token
The access token that getToken() returns is a JWT signed with EdDSA (Ed25519) by the region that stores the user. It is valid for 600 seconds. Your backend verifies it with Fox Login's public keys, without calling Fox Login; see Verify tokens.
Claims
| Claim | Example | Meaning |
|---|---|---|
alg (header) |
"EdDSA" |
Signing algorithm. Fox Login signs with EdDSA only. |
kid (header) |
"eu-v1" |
ID of the signing key, in the form <region>-v<N>. Look it up in the JWKS. |
iss |
"https://api.foxlogin.app" |
Issuer. The same value for every region. |
sub |
"usr_eu_8f2c91a7" |
User ID. Store this one. Its prefix names the region. |
rgn |
"EU" |
Region that stores the user's personal data: EU or TR today. Accept other values, because more regions will follow. |
app |
"app_8f2c91a7" |
Application ID. |
sid |
"ses_8f2c91a7" |
Session ID. Sign-out, a password reset or reuse of a refresh token revokes the session. |
labels |
{ "store": "kadikoy" } |
Labels you set on the user, as an object. Empty when there are none. |
iat |
1796202000 |
Issued at, in Unix seconds. |
exp |
1796202600 |
Expires at, 600 seconds after iat. |
A decoded token looks like this:
{ "alg": "EdDSA", "kid": "eu-v1", "typ": "JWT" }{
"iss": "https://api.foxlogin.app",
"sub": "usr_eu_8f2c91a7",
"rgn": "EU",
"app": "app_8f2c91a7",
"sid": "ses_8f2c91a7",
"labels": { "store": "kadikoy" },
"iat": 1796202000,
"exp": 1796202600
}Using the claims
subis the key for everything you store about the user in your own database.labelstravel inside the token, so your backend can make decisions such as "which store does this user belong to" without a call to Fox Login. You set them when you create a user through the Management API.rgntells you where the user's data is stored, for example to show it on a privacy page.apptells applications apart when one backend serves several of them. PassapplicationIdtoverifyTokento accept only one.sididentifies the session, for your own audit log or a list of revoked sessions.