I am developing a custom WordPress plugin to retrieve the page views and URL of posts. According to gaDataAuthorization, Plugin is an installed application.
我正在开发一个自定义WordPress插件来检索页面视图和帖子的URL。根据gaDataAuthorization,Plugin是一个已安装的应用程序。
And ouath2InstalledApp. Here I read it is same as Using OAuth 2.0 for Web Server Applications, having three differences.
并且ouath2InstalledApp。在这里,我读到它与使用OAuth 2.0 for Web Server Applications相同,有三个不同之处。
But when I am trying to use urn:ietf:wg:oauth:2.0:oob
as the redirect URI, it is not working. Can anybody give me any idea?
但是当我尝试使用urn:ietf:wg:oauth:2.0:oob作为重定向URI时,它无效。任何人都可以给我任何想法吗?
In the developer console it alerts:
在开发者控制台中它会发出警报
Must have a protocol. Cannot contain URL fragments or relative paths. Cannot be a public IP address. '
必须有一个协议。不能包含URL片段或相对路径。不能是公共IP地址。 “
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.redirect_uri |从Google Developers Console获取的redirect_uri值之一。 |确定响应的发送位置。此参数的值必须与Google Developers Console中“凭据”页面中显示的值之一完全匹配(包括http或https方案,大小写和尾部斜杠)。您可以选择urn:ietf:wg:oauth:2.0:oob,urn:ietf:wg:oauth:2.0:oob:auto,或http:// localhost端口。有关更多详细信息,请参阅选择重定向URI。
2 个解决方案
#1
1
The picture below shows where you need to choose "other". The Hello analytics app does not specify it.
下图显示了您需要选择“其他”的位置。 Hello分析应用程序未指定它。
That will create your installedApp (the WordPress plugin is treated as installedApp). Now you do not need to specify redirect URI on your console.
这将创建您的installedApp(WordPress插件被视为installedApp)。现在您不需要在控制台上指定重定向URI。
Another question of mine will guide you better on your further steps. It is How to use refresh token to get authorized in background.
我的另一个问题将指导您更好地采取进一步措施。如何使用刷新令牌在后台获得授权。
#2
0
It seems Google allows you to use any URI as a redirect URI. On the other hand, it seems other software libraries you are using accept only http://
or https://
.
Google似乎允许您将任何URI用作重定向URI。另一方面,您使用的其他软件库似乎只接受http://或https://。
#1
1
The picture below shows where you need to choose "other". The Hello analytics app does not specify it.
下图显示了您需要选择“其他”的位置。 Hello分析应用程序未指定它。
That will create your installedApp (the WordPress plugin is treated as installedApp). Now you do not need to specify redirect URI on your console.
这将创建您的installedApp(WordPress插件被视为installedApp)。现在您不需要在控制台上指定重定向URI。
Another question of mine will guide you better on your further steps. It is How to use refresh token to get authorized in background.
我的另一个问题将指导您更好地采取进一步措施。如何使用刷新令牌在后台获得授权。
#2
0
It seems Google allows you to use any URI as a redirect URI. On the other hand, it seems other software libraries you are using accept only http://
or https://
.
Google似乎允许您将任何URI用作重定向URI。另一方面,您使用的其他软件库似乎只接受http://或https://。