有没有办法在Nativescript Angular App上使用nodejs和护照进行身份验证?

时间:2019-05-03 11:58:46

标签: node.js angular oauth-2.0 passport.js nativescript

我有一个Node.js后端,我在其中实现了Passport JS进行身份验证(用户名密码和Google)。我有两个前端,一个在Angular中的SPA Web应用程序,另一个在{N} Angular中的移动应用程序。

身份验证在Web应用程序中正常工作(请参见下面的流程):

前端(网络应用)

<a href="http://localhost:3000/auth/google">Google Sign In</a>

后退

loginRouter.get('/auth/google', passport.authenticate('google', { scope : 'email' }));

loginRouter.get('/auth/google/callback', passport.authenticate('google', {successRedirect: "http://localhost:4200/home?blob=dataWithToken"}));

问题

我的问题是,“如何在Nativescript中实现此流程?”

我试图在我的{N}应用中添加Web视图,但是出现以下错误:

google can't sign you in safely inside this app ...

有什么想法吗?有游乐场吗?

0 个答案:

没有答案