Token storage location

memesaregooda month ago

What table are the user tokens held in? Are they stored in the DB?

Anton Tananaeva month ago

They are not stored anywhere.

memesaregooda month ago

Does this mean that they are rendered invalid each time an instance is restarted?

Anton Tananaeva month ago

No.

memesaregooda month ago

If they are not stored anywhere, and yet they're still valid after a server restart, that means they're stored somewhere else? Where? How are they kept persistant?

Anton Tananaeva month ago

They are not stored anywhere.

Kalabinta month ago

Hi,

The tokens are signed JSONs containing:

  • userId
  • expiration date

If you don't give any date at creation they will be 7 Days valid.
They are signed with a key stored in the Traccar DB (tc_keystore table), so only the key pair appears in the database.

This is how tokens remain valid despite server restarts.

For full implementation details see this folder in the source code of Traccar.

memesaregooda month ago

Hi, thank you for the info!