繁体   English   中英

Oauth2 游乐场 - 在“输入您的范围”框中输入范围 - 如何?

[英]Oauth2 playground - Input of scopes in the "input your scopes" box - how?

如何在 oauth2 playground UI 的输入范围框中输入多个范围? 我正在尝试使用此链接生成身份验证/刷新令牌: https : //developers.google.com/oauthplayground

我在选择 API 范围时找不到我需要的范围: https : //www.googleapis.com/auth/script.external_request https://www.googleapis.com/auth/script.send_mail

因此,我试图将其包含在“输入您的范围框”中。 我可以包括其中之一,但只能在框中输入一个范围。 我如何包括两者?

我尝试了以下但没有成功https://www.googleapis.com/auth/script.external_request,https://www.googleapis.com/auth/script.send_mail

https://www.googleapis.com/auth/script.external_request;https://www.googleapis.com/auth/script.send_mail

"https://www.googleapis.com/auth/script.external_request","https://www.googleapis.com/auth/script.send_mail"

https://www.googleapis.com/auth/script.external_request + https://www.googleapis.com/auth/script.send_mail

通常对于 Google,范围应该用空格分隔:

https://www.googleapis.com/auth/script.external_request https://www.googleapis.com/auth/script.send_mail

Facebook 使用逗号,Instagram 使用加号……这里列出了一些示例: https : //brandur.org/oauth-scope#google

不幸的是,OAuth 2.0 规范没有明确定义多范围,因此 OAuth 提供者使用了不同的分隔符,因此 OAuth Playground 使用一个哑文本字段来指定多个范围。

我是这样解决这个问题的: 我做了我的选择,在 OAuth 操场上添加了客户端 ID、秘密等: https : //developers.google.com/oauthplayground/

我点击了链接图标以获取所做选择的链接获取网址的链接

C。 然后我编辑了 URL 以包含我想要的范围,如下所示(以粗体显示):

https://developers.google.com/oauthplayground/#step1&apisSelect= https%3A%2F%2Fmail.google.com%2F%2C https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fscript.send_mail%2C https %3A%2F%2Fwww.googleapis.com%2Fauth%2Fscript.external_request &url=myurl&content_type=application%2Fjson&http_method=POST&useDefaultOauthCred=checked&oauthEndpointSelect=Google&oauthAuthEndpointValue=somevalue&oauthTokenEndpointValue=somevalue&oauthTokenEndpointValue=somevalue&oauthTokenEndpointValue=somevalue&oauthTokenEndpointValue=somevalue&oauthTokenEndpointValues

d. 最后,我将此 URL 粘贴到浏览器中,授权 API 并继续获取 Auth 密钥。

暂无
暂无

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

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