Service Accounts stop working after restart

Description

Service accounts stop working after OpenLMIS is restarted.

Steps:

  1. Start OpenLMIS

  2. Login as Administrator

  3. Navigate to Admistration -> Service Accounts

  4. Click "Add"

  5. Note the "Key" created.

  6. Open a new tab with the URL of the application and the api /api/Device?access_token={key} where {key} is the key you copied.

  7. Stop OpenLMIS without destorying the database

  8. Change openlmis ref distro's settings.env to set the variable spring_profiles_active=production. Not demo data or any other profile.

  9. Restart OpenLMIS, the database should be preserved.

  10. Reload your browser tab with /api/Device open and reload it.

  11. Notice that you receive an "invalid token" error.

Expected:
The service token should continue to work.

Environment

None

Status

Assignee

Sebastian Brudziński

Reporter

Josh Zamor

Labels

None

Story Points

3

Time tracking

24h

Components

Sprint

None

Fix versions

Priority

Critical