0

我正在使用 Square Connect,但在使用 OAuth API 时遇到了问题。( Square Connect OAuth API )

当我在应用程序页面设置 https 重定向 URL 时,端点给了我一个错误响应,但没有显示登录页面。如果我发送相同的请求设置 localhost (http),它工作正常。为什么我会被拒绝访问?我需要为 https 重定向 URL 做任何额外的事情吗?

  1. https redirect-url (Failed)
    SSL 是自签名证书的详细信息,重定向 url 是https://{MY_SERVER}/callback,并且 iptables 已停止。

    • 要求
      https://squareup.com/oauth2/authorize?client_id={MY_APPLICATION_ID}&response_type=code&session=false&state=test
    • 打回来
      https://{MY_SERVER}/callback?state=test&error=access_denied&error_description=Authorization+not+allowed&response_type=code
  2. http redirect-url (Success)
    Redirect url 的详细信息是http://localhost/callback.

    • 要求
      https://squareup.com/oauth2/authorize?client_id={MY_APPLICATION_ID}&response_type=code&session=false&state=test
    • 打回来
      http://localhost/callback?state=test&code={MY_CODE}&response_type=code

任何帮助将不胜感激!

4

1 回答 1

3

我是 Square Connect 的开发者之一。

默认情况下,应用程序禁用 OAuth 流程,这就是您看到“不允许授权”失败的原因。如果您希望为您的应用程序启用 OAuth 流,那么您需要联系 Square。

于 2014-02-25T18:13:33.873 回答