How an application user should get a JWT token?

Viewed 212
  1. I have several worker services that are running background tasks.
  2. I have an Identity Service that authenticates and create JWT tokens.
  3. The worker services need to consume REST API's that are authorized through the JWT tokens (step 2).
  4. My problem: I need to authenticate the worker service at the Identity Service in order to get a valid JWT token so that it can consume the REST API's.

What is the best solution for this problem?

  • The authentication of the worker service should be a traditional user/password login, just like any "human" user?

OR

  • The worker service authenticates with an API Key and receives a JWT token with all the predefined roles? In this case, functionalities like the refresh token doesn't make sense, right?

Thanks for your help!

1 Answers
Related