Getting a token

There are two ways to get a token: in the console of the ionadmin module or through the token service of the rest module.

All generated tokens are stored in the ion_user_tokens collection in the application database

Getting a permanent token via the ionadmin module

To get a token through the administrator’s console, go to the navigation item “Web Services Security Keys” of the ionadmin module, for example by going to the address locahost:8888/ionadmin/token

On the “Security Token Generator page”:

  • Enter the user name in the “User Name” field
  • Enter “local” in the “Account Type” field
  • Click the “Generate Token” button
  • The “Token” field will display a token value similar to 3a546090355317c287886c0e81dfd304fa5bda99, and it should be used as the auth-token header value.

The default token lifetime is 100 years.

Getting a temporary token via the rest/token service

The second way to get a token is to use the web service of the rest module - token. You can get a token via an authenticated request to the address rest/token. More details: Built-in “token” service.