Why do only OAuth 2.0 Playground access tokens work for Google API?

时间秒杀一切 提交于 2019-12-02 12:38:25

Figured this out.

I believe the issue was that the access token in Postman required more scopes to authenticate me fully, which makes sense since this API contains surveys that I am trying to access, which are also linked to a Google account. This started working only after I added the consumersurveys.readonly scope (using A SPACE) along with the userinfo.email scope, as outlined below.

This SCOPE SETTING alone didn't work: https://www.googleapis.com/auth/userinfo.email

This SCOPE SETTING with more permission to this API DID work! https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/consumersurveys.readonly

More info on adding scopes to C# code can be found here: http://www.oauthforaspnet.com/providers/google/

Hope this helps anyone else out there who runs into a similar issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!