星期二, 8月 13, 2019

[node.js] passport.js OAuth2 api的社群整合

記錄一下撰寫node.js的restful api串接社群按鈕。
基本上流程因前端是react app,
所以會使用前端的fb/google sdk來取得access token,
再提供restful api來驗證access token,
成功後就可以取得Oauth的用戶資訊,
接著就是自已server 用戶資料,如何連結社群的邏輯。

node.js套件

https://github.com/jaredhanson/passport-facebook
https://github.com/jaredhanson/passport-facebook-token
https://github.com/jaredhanson/passport-google-oauth2https://github.com/davidep87/passport-token-google
https://github.com/jmreyes/passport-google-id-token (暫時沒使用)

其他你感興趣的文章

Related Posts with Thumbnails