未获得 Google Analytics 安装应用程序(自定义插件)的正确重定向 URI

Not getting correct redirect URI for Google Analytics installedapp (custom plugin)

我正在开发一个自定义 WordPress 插件来检索页面浏览量和 URL 帖子。根据 gaDataAuthorization,Plugin 是一个已安装的应用程序。

ouath2InstalledApp. Here I read it is same as Using OAuth 2.0 for Web Server Applications,有三处不同。

但是当我尝试使用 urn:ietf:wg:oauth:2.0:oob 作为重定向 URI 时,它不起作用。谁能告诉我任何想法?

在开发者控制台中它提醒:

Must have a protocol. Cannot contain URL fragments or relative paths. Cannot be a public IP address. '

redirect_uri | One of the redirect_uri values obtained from the Google Developers Console. | Determines where the response is sent. The value of this parameter must exactly match one of the values that appear in the Credentials page in the Google Developers Console (including the http or https scheme, case, and trailing slash). You may choose between urn:ietf:wg:oauth:2.0:oob, urn:ietf:wg:oauth:2.0:oob:auto, or an http://localhost port. For more details, see Choosing a redirect URI.

似乎 Google 允许您使用任何 URI 作为重定向 URI。另一方面,您使用的其他软件库似乎只接受 http://https://.

下图是需要选择的地方"other"。 Hello 分析应用程序未指定它。

这将创建您的 installedApp(WordPress 插件被视为已安装的应用程序)。现在您无需在控制台上指定重定向 URI。

我的另一个问题将指导您更好地进行进一步的操作。即.