Authentication and session management

Login

  • Users log in to the field app with their User ID and password (see How-to Guide: Installing the Avni field app).
  • Login requires an internet connection. Identity is verified over OpenID Connect against the identity server (Amazon Cognito on the Avni hosted service), which issues signed JWT tokens to the device.

Tokens and validity

TokenPurposeValidity
ID / Access tokenSent with every API call to authenticate the user1 hour
Refresh tokenRenews the ID/access token without the user re-entering their password30 days (default)
  • Token renewal is automatic and needs no user action — whenever the app talks to the server (login, manual sync, auto sync), an expired access token is renewed in the background using the refresh token.
  • The app never asks for the password again while the refresh token is valid.

Offline sessions

  • After login, the app works completely offline except for sync.
  • After 30 days of inactivity (no successful sync), the session expires and the user is logged out — they must go online and log in again to continue data entry.
  • Nothing is lost when this happens: data captured offline stays on the device, and after re-login sync resumes incrementally (the database is intact, so fast sync is not triggered again).
  • Recommended field practice: sync whenever connectivity is available — this keeps the session fresh well within the token validity.

Logout

  • Logging out requires an internet connection — the logout action itself communicates with the server, and the next login does too.
  • Logout does not delete local data — unsynced records are preserved on the device.
  • Field users should stay logged in between field days; there is no security or operational need to log out.

One user per device

  • The app holds one user's data at a time. If a different User ID attempts to log in on the same device, the app warns that proceeding will delete the previous user's unsynced data, and continues only on explicit confirmation. The new user then starts with a fresh database for their own catchment (via fast sync where available).