Angular Facebook登录URL:已阻止(未列入白名单)
我注册了Facebook社交登录,我使用的是API的v2.10 我可以让登录窗口很好地打开,但是我得到了以下错误 URL已阻止:此重定向失败,因为重定向URI不可用 应用程序客户端OAuth设置中的白色列表。确保 客户端和web OAuth登录已打开,并将所有应用程序域添加为 有效的OAuth重定向URI 我尽了一切努力让它工作,但似乎无法解决这个问题 **环境Angular Facebook登录URL:已阻止(未列入白名单),angular,facebook,oauth-2.0,facebook-javascript-sdk,Angular,Facebook,Oauth 2.0,Facebook Javascript Sdk,我注册了Facebook社交登录,我使用的是API的v2.10 我可以让登录窗口很好地打开,但是我得到了以下错误 URL已阻止:此重定向失败,因为重定向URI不可用 应用程序客户端OAuth设置中的白色列表。确保 客户端和web OAuth登录已打开,并将所有应用程序域添加为 有效的OAuth重定向URI 我尽了一切努力让它工作,但似乎无法解决这个问题 **环境 视窗10 角度5 节点8.10 可在和处ping 我尝试过的: 添加重定向uri的所有可能变体。包括窗口中列出的uri。(&re
- 视窗10
- 角度5
- 节点8.10
- 可在和处ping
- 添加重定向uri的所有可能变体。包括窗口中列出的uri。(
)&redirect_-uri)=https://staticxx.facebook.com/connect/xd_arbiter/r/FdM1l_dpErI.js?version=42#cb=f2332406d58ffb
- 根据,添加了主机文件配置以重定向到非本地主机
- 试图跟踪任何调试信息。尝试网络检查器查看它是否在任何地方等
- 通读这本书
-
- 双重检查顶级应用程序设置下的域
127.65.43.21 scormify.app
(也有netsh)
FB SDK Init仅供参考,不认为这与此有关
```
window.fbAsyninit=函数(){
FB.init({
appId:'xxx',
曲奇:是的,
xfbml:是的,
版本:“v2.10”
}))
});
```
Angular 5 Svc代码我认为这也不是问题所在,仅供参考
linkFb() {
return FB.login(result => {
if (result.authResponse) {
return this.http.post(`https://localhost:5000/api/v1/account/link/fb/callback`, { access_token: result.authResponse.accessToken }).map((res: ApiResponse) => res)
}
}, { scope: 'public_profile,email' });
}
路线
.post(
'/account/link/fb',
passport.authenticate('facebook-token', { session: false }),
account.linkFb
)
.get('/account/link/fb/callback', account.linkFbCb)
护照策略
passport.use(
new FacebookStrategy(
{
clientID: config.FACEBOOK_APPID,
clientSecret: config.FACEBOOK_SECRET,
callbackURL: `https://localhost:5000/api/v1/account/link/fb/callback`,
profileFields: ['name', 'email', 'link'],
passReqToCallback: true
},
(req, accessToken, refreshToken, profile, done) => {
console.log(req);
console.log(profile);
// make profile;
// make provider
//store.upsertUser();
}
)
);
};
应用程序运行的url是什么?编辑:添加了我的环境如果您的本地url是,则应在重定向uri中添加“”。同时启用顶部的“客户端OAuth登录”选项。Localhost:5000是第二个条目。我已经打开和关闭了所有设置。您是否启用了“客户端OAuth登录”选项?
passport.use(
new FacebookStrategy(
{
clientID: config.FACEBOOK_APPID,
clientSecret: config.FACEBOOK_SECRET,
callbackURL: `https://localhost:5000/api/v1/account/link/fb/callback`,
profileFields: ['name', 'email', 'link'],
passReqToCallback: true
},
(req, accessToken, refreshToken, profile, done) => {
console.log(req);
console.log(profile);
// make profile;
// make provider
//store.upsertUser();
}
)
);
};