简体   繁体   中英

node.js - hapi.js facebook integration (login, registration)

I'm totally noob in hapi.js

What is the best way to do login and registration via facebook with hapi framework? Frontend will send me token, after that I need to connect again to facebook from backend and check user id.

I didn't find tutorial or documentation what explain that implementation with some examples.

I saw lib as passport but only for express.js. Is there any simple way to connect hapijs framework with facebook?

Finally I just did simple request with accessToken by axios to facebook/graph and it's work.

Did you integrate hapi.js with other libraries with complex communication? I tried to use hapijs/bell but it doesn't work for me. Thanks for your response.

In my company, we did the FB login "from scratch". The client send the user info in case it's a signUp call and also a accessToken.

We then check with facebook that the access token is registered with the same email than the one the client send us.

Last verification is that the fbId sent by the client is the same as the one we saved in the database.

It seems to me that it looks like your workflow... It is really possible that we have done something not so secured… I will check Bell in case

@hapi/bell is your best bet https://hapi.dev/module/bell/providers#facebook

Try with their latest documentation and see if it works now

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM