Javascript 获取错误“;重定向“uri URL必须是绝对的”;在本机iOS应用程序中使用PassportJS和Nodejs
我将PassportJS与Node和Express一起使用。我在本机iOS应用程序中这样做。当我通过Facebook的节点启动基于API的身份验证时,我得到一个指向Facebook的重定向URL,当我尝试将其加载到web视图时,我得到一个错误,说“重定向uri URL必须是绝对的。” 这个项目没有网站,它只是一个应用程序,所以我在回拨URL中指定了深层链接Javascript 获取错误“;重定向“uri URL必须是绝对的”;在本机iOS应用程序中使用PassportJS和Nodejs,javascript,ios,node.js,facebook,passport.js,Javascript,Ios,Node.js,Facebook,Passport.js,我将PassportJS与Node和Express一起使用。我在本机iOS应用程序中这样做。当我通过Facebook的节点启动基于API的身份验证时,我得到一个指向Facebook的重定向URL,当我尝试将其加载到web视图时,我得到一个错误,说“重定向uri URL必须是绝对的。” 这个项目没有网站,它只是一个应用程序,所以我在回拨URL中指定了深层链接 //setup facebook authentication passport.use(new FacebookStrategy({
//setup facebook authentication
passport.use(new FacebookStrategy({
clientID: "13434543",
clientSecret: "fdaf323432fadfa134",
callbackURL: "sixdwf://deeplink?facebook=/auth/facebook/callback"
},
function(accessToken, refreshToken, profile, done) {
User.findOrCreate(accessToken, refreshToken, profile, done, function(err, user) {
if (err) { return done(err); }
done(null, user);
});
}
));
// Redirect the user to Facebook for authentication. When complete,
// Facebook will redirect the user back to the application at
// /auth/facebook/callback
app.get('/auth/facebook', passport.authenticate('facebook', { scope: ['public_profile', 'email' , 'user_friends'] }));
// Facebook will redirect the user to this URL after approval. Finish the
// authentication process by attempting to obtain an access token. If
// access was granted, the user will be logged in. Otherwise,
// authentication has failed.
app.get('/auth/facebook/callback',
passport.authenticate('facebook', { successRedirect: '/',
failureRedirect: '/login' }));
// app.post("/account/login", function(req,res)
// {
// actMgr.handleLogin(req,res);
// });
知道如何克服这个问题吗?给出绝对回调URL,如下所示
www.mytestOauth.com/auth/twitter/callback
代替
sixdwf://deeplink?facebook=/auth/facebook/callback
我也面临同样的问题,它是有效的