authentication – what would be the best approach for generating a JWT token for server-to-server communications?

I plan to develop an authentication service that generates and validates the JWT token for incoming requests.
What would be the best challenge mechanism that could be used to generate the JWT token?
Since the request is generated from an application and not from an end user, the combination username / password is excluded in this case.
I am looking to explore areas such as Token Generation based on the keystore.
All contributions would be welcome.
Thanks in advance