JWT exchanged access token signature invalid
This is regarding the Technical account created from Cloud manager => Integrations. I am trying about the nodejs sample code given in aem documentation for generating the JWT followed by exchanging it for access token using /ims/exchange/jwt . Since a external application will be using it i need to validate the access token sent in request to our application . I am using "com.auth0/java-jwt" libraries to verify the access token. But the only error i keep getting is
The Token's Signature resulted invalid when verified using the Algorithm: SHA256withRSA
I have confirmed that the private/public keys match (with openSSL commands), the original JWT created using private key is verified with the public key both by code and jwt.io. But when it comes to verifying the access token exchanged for that same JWT that does not get verified with the public key through the code as well jwt.io. What can be the reason? Is Oauth Server-to-Server a better workable option?