I am trying to implement social login with angular 5 as my front-end and lumen 5.6 as my backend.
I am using JWT Authentication system with Lumen. So, I am confused here how I should implement social login system in this situation.
Through my research I have come to these libraries which can do that work, but I am not sure how the process is handled from the front-end (angular) to back-end (lumen).
For Angular 5 -
angularx-social-login OR Satellizer
For Lumen -
laravel/socialite
But as I have not found any documentation on Satellizer working with Angular 5, so I choosed to use other one.
I have read this article, but still the process from front-end to back-end is not clear to me. https://medium.com/@barryvdh/oauth-in-javascript-apps-with-angular-and-lumen-using-satellizer-and-laravel-socialite-bb05661c0d5c
Any explanatory help ?
So the way I used social login with Angular 5 is with a package called
"angular5-social-login": "^1.0.9",So add that to your
package.jsonfile.Import it in
app.module.tsimport { SocialLoginModule, AuthServiceConfig, GoogleLoginProvider, FacebookLoginProvider } from 'angular5-social-login';Set up a function in
app.module.tsAdd it to your Imports in
app.module.tsThen at the add it to your providers in
app.module.tsAs you can see i have a
LoggedInGuardand aApiAuthServicethese are these with the auth and checking your logged in.So That's the package installed and set up...
Now inside of
api-auth.service.tsadd this functionNow in your sign in component add this to the HTML
In your sign in component .ts file add this function
This is just the front end now for the back end. I'm using Laravel 5.6
But I made a function like this
I will most probably make a video on this soon. Any questions just ask