loopback-example-passport | LoopBack example for facebook login | OAuth library
kandi X-RAY | loopback-example-passport Summary
kandi X-RAY | loopback-example-passport Summary
LoopBack example for loopback-passport module. It demonstrates how to use LoopBack's user/userIdentity/userCredential models and passport to interact with other auth providers.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of loopback-example-passport
loopback-example-passport Key Features
loopback-example-passport Examples and Code Snippets
Community Discussions
Trending Discussions on loopback-example-passport
QUESTION
I trying to implement login facebook by using Loopback as API,
Following http://loopback.io/doc/en/lb3/Tutorial-third-party-login.html and https://github.com/strongloop/loopback-example-passport I can't apply the tutorial to my case because at the example, client side and server side are on the same project.
My app:
Web application (NextJS custom express server)
- example endpoint: www.myapp.com
- User click login by facebook button to get access_token after that send to API.
API application (Loopback)
- example endpoint: www.api-myapp.com
- API get access_token from client then fetch data from facebook graph API.
- If email is existed then auto-login and return token to the client.
- Else register a new user and return token to the client.
From the following flow, I can't implement this flow by using Loopback :( I can register/login via username and password in a normal case but I confusing to register/login by facebook login.
...ANSWER
Answered 2018-May-03 at 15:10This behavior would be very easy to implement using Loopback. Assuming you are following the third party login documentation, you would simply:
- Enable
facebook-passport
authentication. - Create a button in your frontend for "login with facebook" which redirects the user to the
authpath
(iehttp:///auth/facebook
). - Set the
successRedirect
tohttp:///
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install loopback-example-passport
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page