I'm trying to authenticate requests using JWT tokens created client side. I've created a service account in my project and downloaded the key JSON. From that JSON I got the private key and use it to sign the tokens. I've tried to use different packages to create the token, I've also tried both RS256 and RS512 signatgures but keep getting:
error: 401: {
"code": 16,
"message": "JWT validation failed: BAD_SIGNATURE",
"details": [
{
"stackEntries": [],
"detail": "auth"
}
]
}
I'm not sure if it's something I haven't setup right in the project or whether it's something with with the tokens themselves. FWIW I use the same algorithm to create and sign JWT tokens in other services and they work just fine. Any advice on how to proceed with troubleshooting this? the logs don't have more information.
Thanks!
--
Raphael.