https://github.com/high54/angular-6-social-login
Original project : high54Social login api for Angular 6. Includes Facebook, Google login, Linkedin, Vkontakte.
AOT Compatible.
Getting started
Install via npm
npm install --save angular-6-social-login-v2
Import the module
In app.module.ts
,
... ; // Configs { let config = id: FacebookLoginProviderPROVIDER_ID provider: "Your-Facebook-app-id" id: GoogleLoginProviderPROVIDER_ID provider: "Your-Google-Client-Id" id: VkontakteLoginProviderPROVIDER_ID provider: "Your-VK-Client-Id" id: LinkedinLoginProviderPROVIDER_ID provider: "1098828800522-m2ig6bieilc3tpqvmlcpdvrpvn86q4ks.apps.googleusercontent.com" ; ; return config;} @
Usage :
In signin.component.ts
,
;; @ implements OnInit {} public { let socialPlatformProvider; ifsocialPlatform == "facebook" socialPlatformProvider = FacebookLoginProviderPROVIDER_ID; else ifsocialPlatform == "google" socialPlatformProvider = GoogleLoginProviderPROVIDER_ID; else if socialPlatform == "linkedin" socialPlatformProvider = LinkedinLoginProviderPROVIDER_ID; else if socialPlatform == "vkontakte" socialPlatformProvider = LinkedinLoginProviderPROVIDER_ID; thissocialAuthService; }
In signin.component.html
,
Sign in Sign in with FacebookSign in with GoogleSign in with VKontakte
Facebook App Id :
You need to create your own app by going to Facebook Developers page.
Add Facebook login
under products and configure Valid OAuth redirect URIs
.
Google Client Id :
Follow this official documentation on how to Create a Google API Console project and client ID.
Vkontakte Open API :
Follow this official documentation on how to Open API work
For use you need create Standalone app and then set configuration Open API: ON
.