I am implementing JWT token based authentication for our WebAPI in order to restrict data access through the API (e.g. client sends username / password and the api provides a jwt token valid for x hours). We currently have recurring background processes that need to access that data. What is the best practice related to this scenario?
I read somewhere that since the service is a confidential type of client that we can store the credential in code similar to access-key/secret. I don't like configuring or hard coding passwords but this seems like the valid approach for the use case.
NOTE: this question has been suggested as duplicate for where to store private keys but the crux of the question is more on ideas on which approach is better for authentication related to background services.