Client is unauthorized to retrieve access tokens using this method Gmail APIClient is unauthorized to retrieve access tokens using this method Gmail API C#Error 500 backendError with Gmail API and Google APIs Node ClientGmail API - Delegating domain-wide authority to the service account to single userGmail Api return Unauthorized client or scope in requestSetting the SendAs via python gmail api returns “Custom display name disallowed”Gmail API Signature Server SideGmail API using C# to update signatureGoogleJsonResponseException: Not Found error when using Gmail API sendAs.patch method to change signature for user on domainGoogle Suite - Google API access - Client is unauthorized to retrieve access tokens using this methodGmail API Set Forwarding with Service Accountclient is unauthorized to retrieve access tokens using this method service account error
Where does "0 packages can be updated." come from?
Russian equivalents of "no love lost"
Was the Tamarian language in "Darmok" inspired by Jack Vance's "The Asutra"?
Compiling c files on ubuntu and using the executable on Windows
Why was the Sega Genesis marketed as a 16-bit console?
Find the Factorial From the Given Prime Relationship
How to build suspense or so to establish and justify xenophobia of characters in the eyes of the reader?
Soft question: Examples where lack of mathematical rigour cause security breaches?
How did they achieve the Gunslinger's shining eye effect in Westworld?
Can a user sell my software (MIT license) without modification?
Can anyone identify this tank?
Is it possible to 'live off the sea'
Should I give professor gift at the beginning of my PhD?
Taxi Services at Didcot
Was Jesus good at singing?
Movie about a boy who was born old and grew young
PhD - Well known professor or well known school?
Do simulator games use a realistic trajectory to get into orbit?
Does an ice chest packed full of frozen food need ice?
Do any instruments not produce overtones?
How to retract an idea already pitched to an employer?
How to chain Python function calls so the behaviour is as follows
Inconsistent behavior of compiler optimization of unused string
Winning Strategy for the Magician and his Apprentice
Client is unauthorized to retrieve access tokens using this method Gmail API
Client is unauthorized to retrieve access tokens using this method Gmail API C#Error 500 backendError with Gmail API and Google APIs Node ClientGmail API - Delegating domain-wide authority to the service account to single userGmail Api return Unauthorized client or scope in requestSetting the SendAs via python gmail api returns “Custom display name disallowed”Gmail API Signature Server SideGmail API using C# to update signatureGoogleJsonResponseException: Not Found error when using Gmail API sendAs.patch method to change signature for user on domainGoogle Suite - Google API access - Client is unauthorized to retrieve access tokens using this methodGmail API Set Forwarding with Service Accountclient is unauthorized to retrieve access tokens using this method service account error
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
As many other people wrote, I encounter the issue as well, I got it while trying to set new email signature via the API
The exact API call is:
sendAsConfiguration =
'signature': 'Test email signature'
result = gmailService.users().settings().sendAs().patch(userId='xxx@domain.com',
sendAsEmail="xxx@domain.com",
body=sendAsConfiguration).execute()
The exact response is:
google.auth.exceptions.RefreshError: ('unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.', 'n "error": "unauthorized_client",n "error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."n')
My scenario is as follow:
- I'm working with Python from GCP Cloud Functions
- I manage doing requests to the G Suite directory admin, from the same code base and settings
- I made a service account with wild delegation. And I added the right scope both in code and in the G Suite account.
- When trying to work with the gmail API it doesn't work.
- I have created a new project, and deployed the exact same code (with settings of a new service account of course) and all worked well.
- I repeated all the steps for creating the service account on the original project, it still didn't work.
I need it to work from the production project, and not the test one.
I have read the following questions and answers (and many other variants of them) and nothing worked answer 1, answer 2
Regarding answer 2, I'm not sure I understood this one, so if this the real solution, it would be great getting specific steps.
I'm not adding the code itself, since it is working for sure (was tested on an different project, and worked). Please see below the settings of the service account
G Suite settings
At the beginning I had both scopes under the same service account, I got the same result. In the last test I tried each service account having only one scope. Same result
Service account settings
Would be great getting help with that,
UPDATE 1
I have no OAuth credentials, please see the image below
UPDATE 2
I have compared between the project who worked and the one that didn't. The only difference I noticed is, that in the working project there were no API keys. Since people wrote regarding the OAuth, I thought I might give it a chance. But since this is a production environment I don't want to remove them, especially since it was auto generated by Google, and I have no idea where they are being used. I think they aren't used anywhere, but I'm not sure.
I tried adding to the working account an API key, and it still worked, which gave me more motivation leaving the production settings untouched.
UPDATE 3
I have removed the API keys, it didn't help.
Thanks
gmail-api
add a comment |
As many other people wrote, I encounter the issue as well, I got it while trying to set new email signature via the API
The exact API call is:
sendAsConfiguration =
'signature': 'Test email signature'
result = gmailService.users().settings().sendAs().patch(userId='xxx@domain.com',
sendAsEmail="xxx@domain.com",
body=sendAsConfiguration).execute()
The exact response is:
google.auth.exceptions.RefreshError: ('unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.', 'n "error": "unauthorized_client",n "error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."n')
My scenario is as follow:
- I'm working with Python from GCP Cloud Functions
- I manage doing requests to the G Suite directory admin, from the same code base and settings
- I made a service account with wild delegation. And I added the right scope both in code and in the G Suite account.
- When trying to work with the gmail API it doesn't work.
- I have created a new project, and deployed the exact same code (with settings of a new service account of course) and all worked well.
- I repeated all the steps for creating the service account on the original project, it still didn't work.
I need it to work from the production project, and not the test one.
I have read the following questions and answers (and many other variants of them) and nothing worked answer 1, answer 2
Regarding answer 2, I'm not sure I understood this one, so if this the real solution, it would be great getting specific steps.
I'm not adding the code itself, since it is working for sure (was tested on an different project, and worked). Please see below the settings of the service account
G Suite settings
At the beginning I had both scopes under the same service account, I got the same result. In the last test I tried each service account having only one scope. Same result
Service account settings
Would be great getting help with that,
UPDATE 1
I have no OAuth credentials, please see the image below
UPDATE 2
I have compared between the project who worked and the one that didn't. The only difference I noticed is, that in the working project there were no API keys. Since people wrote regarding the OAuth, I thought I might give it a chance. But since this is a production environment I don't want to remove them, especially since it was auto generated by Google, and I have no idea where they are being used. I think they aren't used anywhere, but I'm not sure.
I tried adding to the working account an API key, and it still worked, which gave me more motivation leaving the production settings untouched.
UPDATE 3
I have removed the API keys, it didn't help.
Thanks
gmail-api
From the answer 2, it was stated that the resolution would be likely to remove credentials not belonging to any service account, which leads to this github post, "I resolved my issue by removing all others types of credentials for the app in question (no oauth, just service account)".
– MαπμQμαπkγVπ.0
Mar 25 at 7:00
Thanks @MαπμQμαπkγVπ.0. I'm still puzzled, as far as I know I have no OAuth keys. Please see my attached screenshot. Did I miss anything?
– nheimann1
Mar 25 at 12:20
add a comment |
As many other people wrote, I encounter the issue as well, I got it while trying to set new email signature via the API
The exact API call is:
sendAsConfiguration =
'signature': 'Test email signature'
result = gmailService.users().settings().sendAs().patch(userId='xxx@domain.com',
sendAsEmail="xxx@domain.com",
body=sendAsConfiguration).execute()
The exact response is:
google.auth.exceptions.RefreshError: ('unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.', 'n "error": "unauthorized_client",n "error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."n')
My scenario is as follow:
- I'm working with Python from GCP Cloud Functions
- I manage doing requests to the G Suite directory admin, from the same code base and settings
- I made a service account with wild delegation. And I added the right scope both in code and in the G Suite account.
- When trying to work with the gmail API it doesn't work.
- I have created a new project, and deployed the exact same code (with settings of a new service account of course) and all worked well.
- I repeated all the steps for creating the service account on the original project, it still didn't work.
I need it to work from the production project, and not the test one.
I have read the following questions and answers (and many other variants of them) and nothing worked answer 1, answer 2
Regarding answer 2, I'm not sure I understood this one, so if this the real solution, it would be great getting specific steps.
I'm not adding the code itself, since it is working for sure (was tested on an different project, and worked). Please see below the settings of the service account
G Suite settings
At the beginning I had both scopes under the same service account, I got the same result. In the last test I tried each service account having only one scope. Same result
Service account settings
Would be great getting help with that,
UPDATE 1
I have no OAuth credentials, please see the image below
UPDATE 2
I have compared between the project who worked and the one that didn't. The only difference I noticed is, that in the working project there were no API keys. Since people wrote regarding the OAuth, I thought I might give it a chance. But since this is a production environment I don't want to remove them, especially since it was auto generated by Google, and I have no idea where they are being used. I think they aren't used anywhere, but I'm not sure.
I tried adding to the working account an API key, and it still worked, which gave me more motivation leaving the production settings untouched.
UPDATE 3
I have removed the API keys, it didn't help.
Thanks
gmail-api
As many other people wrote, I encounter the issue as well, I got it while trying to set new email signature via the API
The exact API call is:
sendAsConfiguration =
'signature': 'Test email signature'
result = gmailService.users().settings().sendAs().patch(userId='xxx@domain.com',
sendAsEmail="xxx@domain.com",
body=sendAsConfiguration).execute()
The exact response is:
google.auth.exceptions.RefreshError: ('unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.', 'n "error": "unauthorized_client",n "error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."n')
My scenario is as follow:
- I'm working with Python from GCP Cloud Functions
- I manage doing requests to the G Suite directory admin, from the same code base and settings
- I made a service account with wild delegation. And I added the right scope both in code and in the G Suite account.
- When trying to work with the gmail API it doesn't work.
- I have created a new project, and deployed the exact same code (with settings of a new service account of course) and all worked well.
- I repeated all the steps for creating the service account on the original project, it still didn't work.
I need it to work from the production project, and not the test one.
I have read the following questions and answers (and many other variants of them) and nothing worked answer 1, answer 2
Regarding answer 2, I'm not sure I understood this one, so if this the real solution, it would be great getting specific steps.
I'm not adding the code itself, since it is working for sure (was tested on an different project, and worked). Please see below the settings of the service account
G Suite settings
At the beginning I had both scopes under the same service account, I got the same result. In the last test I tried each service account having only one scope. Same result
Service account settings
Would be great getting help with that,
UPDATE 1
I have no OAuth credentials, please see the image below
UPDATE 2
I have compared between the project who worked and the one that didn't. The only difference I noticed is, that in the working project there were no API keys. Since people wrote regarding the OAuth, I thought I might give it a chance. But since this is a production environment I don't want to remove them, especially since it was auto generated by Google, and I have no idea where they are being used. I think they aren't used anywhere, but I'm not sure.
I tried adding to the working account an API key, and it still worked, which gave me more motivation leaving the production settings untouched.
UPDATE 3
I have removed the API keys, it didn't help.
Thanks
gmail-api
gmail-api
edited Mar 26 at 13:24
nheimann1
asked Mar 24 at 16:29
nheimann1nheimann1
1,77111428
1,77111428
From the answer 2, it was stated that the resolution would be likely to remove credentials not belonging to any service account, which leads to this github post, "I resolved my issue by removing all others types of credentials for the app in question (no oauth, just service account)".
– MαπμQμαπkγVπ.0
Mar 25 at 7:00
Thanks @MαπμQμαπkγVπ.0. I'm still puzzled, as far as I know I have no OAuth keys. Please see my attached screenshot. Did I miss anything?
– nheimann1
Mar 25 at 12:20
add a comment |
From the answer 2, it was stated that the resolution would be likely to remove credentials not belonging to any service account, which leads to this github post, "I resolved my issue by removing all others types of credentials for the app in question (no oauth, just service account)".
– MαπμQμαπkγVπ.0
Mar 25 at 7:00
Thanks @MαπμQμαπkγVπ.0. I'm still puzzled, as far as I know I have no OAuth keys. Please see my attached screenshot. Did I miss anything?
– nheimann1
Mar 25 at 12:20
From the answer 2, it was stated that the resolution would be likely to remove credentials not belonging to any service account, which leads to this github post, "I resolved my issue by removing all others types of credentials for the app in question (no oauth, just service account)".
– MαπμQμαπkγVπ.0
Mar 25 at 7:00
From the answer 2, it was stated that the resolution would be likely to remove credentials not belonging to any service account, which leads to this github post, "I resolved my issue by removing all others types of credentials for the app in question (no oauth, just service account)".
– MαπμQμαπkγVπ.0
Mar 25 at 7:00
Thanks @MαπμQμαπkγVπ.0. I'm still puzzled, as far as I know I have no OAuth keys. Please see my attached screenshot. Did I miss anything?
– nheimann1
Mar 25 at 12:20
Thanks @MαπμQμαπkγVπ.0. I'm still puzzled, as far as I know I have no OAuth keys. Please see my attached screenshot. Did I miss anything?
– nheimann1
Mar 25 at 12:20
add a comment |
1 Answer
1
active
oldest
votes
I found this to be a Roles issue for the service account.
- In your Developers Console -> Project -> IAM ensure that your service account is listed there.
- if it isn't, click Add and start typing the name to add it
- For Role, select Access Approval -> Access Approval Approver
This allowed me to query any domain user's calendar event list.
Thank you, but it doesn't solve my issue. As the question says. It does work for me with the same project for some of the API but not for all. I still didn't solve this issue
– nheimann1
Apr 23 at 14:02
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325978%2fclient-is-unauthorized-to-retrieve-access-tokens-using-this-method-gmail-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I found this to be a Roles issue for the service account.
- In your Developers Console -> Project -> IAM ensure that your service account is listed there.
- if it isn't, click Add and start typing the name to add it
- For Role, select Access Approval -> Access Approval Approver
This allowed me to query any domain user's calendar event list.
Thank you, but it doesn't solve my issue. As the question says. It does work for me with the same project for some of the API but not for all. I still didn't solve this issue
– nheimann1
Apr 23 at 14:02
add a comment |
I found this to be a Roles issue for the service account.
- In your Developers Console -> Project -> IAM ensure that your service account is listed there.
- if it isn't, click Add and start typing the name to add it
- For Role, select Access Approval -> Access Approval Approver
This allowed me to query any domain user's calendar event list.
Thank you, but it doesn't solve my issue. As the question says. It does work for me with the same project for some of the API but not for all. I still didn't solve this issue
– nheimann1
Apr 23 at 14:02
add a comment |
I found this to be a Roles issue for the service account.
- In your Developers Console -> Project -> IAM ensure that your service account is listed there.
- if it isn't, click Add and start typing the name to add it
- For Role, select Access Approval -> Access Approval Approver
This allowed me to query any domain user's calendar event list.
I found this to be a Roles issue for the service account.
- In your Developers Console -> Project -> IAM ensure that your service account is listed there.
- if it isn't, click Add and start typing the name to add it
- For Role, select Access Approval -> Access Approval Approver
This allowed me to query any domain user's calendar event list.
answered Apr 22 at 21:09
sean.hudsonsean.hudson
108212
108212
Thank you, but it doesn't solve my issue. As the question says. It does work for me with the same project for some of the API but not for all. I still didn't solve this issue
– nheimann1
Apr 23 at 14:02
add a comment |
Thank you, but it doesn't solve my issue. As the question says. It does work for me with the same project for some of the API but not for all. I still didn't solve this issue
– nheimann1
Apr 23 at 14:02
Thank you, but it doesn't solve my issue. As the question says. It does work for me with the same project for some of the API but not for all. I still didn't solve this issue
– nheimann1
Apr 23 at 14:02
Thank you, but it doesn't solve my issue. As the question says. It does work for me with the same project for some of the API but not for all. I still didn't solve this issue
– nheimann1
Apr 23 at 14:02
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325978%2fclient-is-unauthorized-to-retrieve-access-tokens-using-this-method-gmail-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
From the answer 2, it was stated that the resolution would be likely to remove credentials not belonging to any service account, which leads to this github post, "I resolved my issue by removing all others types of credentials for the app in question (no oauth, just service account)".
– MαπμQμαπkγVπ.0
Mar 25 at 7:00
Thanks @MαπμQμαπkγVπ.0. I'm still puzzled, as far as I know I have no OAuth keys. Please see my attached screenshot. Did I miss anything?
– nheimann1
Mar 25 at 12:20