简体   繁体   English

如何在 Postman 中设置多个 Oauth2 范围

[英]How to set multiple Oauth2 scopes in Postman

I'm trying to retrieve a course work for a course using the Google Classroom API.我正在尝试使用 Google Classroom API 检索课程的课程作业。 For this it's required multiple scopes.为此,它需要多个范围。 I can get this working from Java so I believe the list of scopes is correct.我可以从 Java 得到它,所以我相信范围列表是正确的。 However, when trying from Postman, I get a 403 "Request had insufficient authentication scopes."但是,从 Postman 尝试时,我收到 403“请求的身份验证范围不足”。 error, which makes me think perhaps the way I'm adding the scopes together may not be correct.错误,这让我觉得我将范围添加在一起的方式可能不正确。 I've already tried using "+", ",", ";"我已经尝试过使用 "+", ",", ";" and also spaces but none of them got rid of the error.还有空格,但没有一个能摆脱错误。 Any ideas about what I may be missing please?请对我可能缺少的东西有任何想法吗?

在此处输入图片说明

Thank you.谢谢你。

Update更新

Showing the Postman console which seems to identify only one scope for the request.显示 Postman 控制台,它似乎只标识请求的一个范围。

![在此处输入图片说明

Perhaps you changed the scopes and forgot to request a new access token and click the use token button or are running on an old access token prior to requesting additional scopes?也许您更改了范围并忘记请求新的访问令牌并单击使用令牌按钮,或者在请求其他范围之前正在使用旧的访问令牌

just tested this using both Google analytics scopes.刚刚使用 Google 分析范围对此进行了测试。

在此处输入图片说明

as you can see the response gives me an access token containing both scopes that i requested.如您所见,响应为我提供了一个包含我请求的两个范围的访问令牌。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM