php - Non G-Suite account service " Client is unauthorized" error - works for emails in G Suite -


i want read emails of @gmail.com email account. i've gone through guides , code samples , keep getting client unauthorized retrieve access tokens using method error message. can access data using oauth2 3 legged method.

i have g-suite admin , g-suite organisation domain , emails. these emails, code works , can retrieve emails.

so, why can't make run personal gmail account (non g-suite)? have somehow authorize service account in gmail account? haven't seen it.

please advise!

thanks.

the short answer : no, can not use service account classic gmail account. use oauthid instead.

the fact talking service account made me think misunderstanding of differences between managed account , gmail account, concerning apis.

indeed, domain managed google account, have possibility use service account. create project, id, , allow domain wide delegation (dwd) service account, domain, no restrictions except apis able use.

in case of gmail account, far different, can not have dwd on gmail.com (or maybe cia ..)

the best option here, use oauth id. it's authentication depends on consent of concerned user.

you can read here

the approach lightly different result same, user can give consent ad vitam aeternam.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -