1
角度2のアプリケーションはlocalhost:4200で動作し、ノードapiサーバーは8080ポートで動作します。ユーザーがシングルサインオン要求をクライアントアプリケーションに正常に完了すると、どのようにしてユーザーデータを渡すことができますか。パスポートを使用した社会的な認証jsと角度2
パスポートJSコード:
router.get('/auth/facebook', passport.authenticate('facebook', { scope: 'email' }));
router.get('/auth/facebook/callback', passport.authenticate('facebook', {
successRedirect: 'http://localhost:4200/',
failureRedirect: 'http://localhost:4200/',
}));
角度2コード:
facebooklogin()
var newWindow = window.open(`http://localhost:8080/auth/facebook`,'name', 'height=585, width=770');
if (window.focus) {
newWindow.focus();
}
/* how can I get the passport session data here */
}