I am following instructions as per link to use Service account authorization without OAuth to create a key ring. https://developers.google.com/identity/protocols/OAuth2ServiceAccount#jwt-auth
I am getting an authorization error: Here's my command. I am running this through a Java code to to generate a JWT bearer token and invoking curl.
curl --request POST https://cloudkms.googleapis.com/v1/projects/<project ID>/locations/global/keyRings?keyRingId=<value> --header Authorization: Bearer <JWT bearer token> --header Accept: application/json --header Content-Type: application/json --data {} --compressed
Erroe message:
POST Response Code : 401
POST Response Message : Unauthorized
POST NOT WORKED
If I use server-to-server OAuth2 method and post with a access token generated using OAUTH2 playgorund, the call is successful. Will the JWT bearer token method will work for KMS?