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.