Token storage location

memesaregood13 days ago

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

Anton Tananaev13 days ago

They are not stored anywhere.

memesaregood13 days ago

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

Anton Tananaev13 days ago

No.

memesaregood13 days 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 Tananaev13 days ago

They are not stored anywhere.

Kalabint13 days 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.

memesaregood13 days ago

Hi, thank you for the info!