"Given URL is not whitelisted in Client OAuth Settings" 在 Facebook 登录测试主机
"Given URL is not whitelisted in Client OAuth Settings" on Facebook login at a test host
我正在使用 Facebook PHP SDK 实现 facebook 登录。我想先在本地测试它。我创建了一个测试应用程序并尝试了很多东西,但仍然不适合我。
在我的本地我配置了一个 apache 虚拟主机,这样我就可以使用这个 url 访问我的本地网络应用程序:http://www.myapplocal.com
这是我在使用 facebook 登录后出现的错误:
Given URL is not whitelisted in Client OAuth Settings: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.
这是我在 oauth 设置部分中的内容:
Client OAuth Login: yes
Web OAuth Login: yes
Force Web OAuth Reauthentication: no
Embedded Browser OAuth Login: no
Valid OAuth redirect URIs: http://www.myapplocal.com/index.php/facebook-login-callback
Login from Devices: no
这是我在 "Basic" (https://developers.facebook.com/apps/appid/settings/basic/) 部分中的内容:
Namespace:
App domains: www.myapplocal.com
Site Url: http://www.myapplocal.com/
在使用 google 登录和使用 twitter 登录后,我不认为使用 facebook 登录会以不同方式处理 URL。问题在于,对于 Facebook,如果您的网站同时支持 www 和不支持 www (http://example.com, http://www.example.com), you have to enter both in the app settings (http://www.example.com/facebook-callback and http://example.com/facebook-callback)
我还发现如果你的站点使用SSL证书,http和https必须在"Valid OAuth redirect URIs"的App中输入。
我正在使用 Facebook PHP SDK 实现 facebook 登录。我想先在本地测试它。我创建了一个测试应用程序并尝试了很多东西,但仍然不适合我。
在我的本地我配置了一个 apache 虚拟主机,这样我就可以使用这个 url 访问我的本地网络应用程序:http://www.myapplocal.com
这是我在使用 facebook 登录后出现的错误:
Given URL is not whitelisted in Client OAuth Settings: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.
这是我在 oauth 设置部分中的内容:
Client OAuth Login: yes
Web OAuth Login: yes
Force Web OAuth Reauthentication: no
Embedded Browser OAuth Login: no
Valid OAuth redirect URIs: http://www.myapplocal.com/index.php/facebook-login-callback
Login from Devices: no
这是我在 "Basic" (https://developers.facebook.com/apps/appid/settings/basic/) 部分中的内容:
Namespace:
App domains: www.myapplocal.com
Site Url: http://www.myapplocal.com/
在使用 google 登录和使用 twitter 登录后,我不认为使用 facebook 登录会以不同方式处理 URL。问题在于,对于 Facebook,如果您的网站同时支持 www 和不支持 www (http://example.com, http://www.example.com), you have to enter both in the app settings (http://www.example.com/facebook-callback and http://example.com/facebook-callback)
我还发现如果你的站点使用SSL证书,http和https必须在"Valid OAuth redirect URIs"的App中输入。