簡體   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