Reputation: 304
I am following this documentation https://cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/signJwt to generate a signed JWT
Path Parameter:
name: projects/-/serviceAccounts/[email protected]
This is my request body
{
"delegates": []
"payload": "{'sub': '[email protected]', 'iat': 1661250118, 'exp': 1661253718, 'aud': 'https://www.googleapis.com/auth/iam'}"
}
I am getting this invalid argument error.
Am I missing something in the payload?
I dont think I have any issues with permission as I was able to get success response when I tried generateAccessToken api call
Upvotes: 0
Views: 468
Reputation: 518
This worked for me by replacing all single quotes ( ' ) with \" (escaping double quotes)
{ "delegates": [], "payload": "{"sub": "[email protected]", "iat": 1661250118, "exp": 1661253718, "aud": "https://www.googleapis.com/auth/iam"}" }
Upvotes: 0
Reputation: 1701
You are missing a comma after "delegates": [],
in the request body. It should follow the structure:
{
"delegates": [
string
],
"payload": string
}
Upvotes: 1