I have implemented an authorization server (spring boot application) using the spring security framework. In the application startup, the RSA key pair is generated and the Json Web Key Set (jwks) is also initialized with a public key. This public key is shared through an endpoint to decrypt the token in the resource server.
Now when the authorization server will be deployed in the multiple nodes, there will be multiple jwks initialized and will cause an issue to identify the appropriate public key from the multiple token stores.
What is the best practice to handle such architecture?