Hello. This is module fork from https://www.npmjs.com/package/angular5-social-auth
AOT Compatible.
Getting started
Install via npm
npm install --save angular5-social-auth2
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: LinkedinLoginProviderPROVIDER_ID provider: "Your-Linkedin-Client-Id" ; ; return config;} @
Usage :
In signin.component.ts
,
;; @ implements OnInit {} public { let socialPlatformProvider; ifsocialPlatform == "facebook" socialPlatformProvider = FacebookLoginProviderPROVIDER_ID; else ifsocialPlatform == "google" socialPlatformProvider = GoogleLoginProviderPROVIDER_ID; else ifsocialPlatform == "linkedin" socialPlatformProvider = LinkedinLoginProviderPROVIDER_ID; thissocialAuthService; }
In signin.component.html
,
Sign in Sign in with FacebookSignin in with GoogleSignin in with Linkedin
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.
Linkedin Client Id :
Follow this official documentation: https://developer.linkedin.com/