What is a token?

Fleet Engine requires the use of JSON Web Tokens (JWTs) for API method calls from low-trust environments: smartphones and browsers.

A JWT originates on your server, is signed, encrypted, and passed to the client for subsequent server interactions until it expires or is no longer valid.

Key details

For more information about JSON Web Tokens, see JSON Web Tokens in Fleet Engine Essentials.

How do clients get tokens?

Once a driver or consumer logs in to your app using the appropriate authorization credentials, any updates issued from that device must use appropriate authorization tokens, which communicates to Fleet Engine the permissions for the app.

As the developer, your client implementation should provide the ability to do the following:

  • Fetch a JSON Web Token from your server.
  • Reuse the token until it expires to minimize token refreshes.
  • Refresh the token when it expires.

The AuthTokenFactory class generates authorization tokens at location update time. The SDK must package the tokens with the update information to send to Fleet Engine. Make sure that your server-side implementation can issue tokens before initializing the SDK.

For details of the tokens expected by the Fleet Engine service, see Issue JSON Web Tokens for Fleet Engine.

Example of an authorization token fetcher