ng Social Login
This is the refrenced library from ng4-social-login.
Social login and authentication module for Angular 4. Supports authentication with Google, Linkedin and Facebook.
Main Feature
This will also return a token (for Facebook and Google) and code (for Linked In) along with profile detail so that logged in user from client side can also be verified on server side.
Getting started
Documentation
Install via npm
npm install --save ng-social-login
Import the module
In your AppModule
, import the SocialLoginModule
; const CONFIG = id: GoogleLoginProviderPROVIDER_ID provider: 'Google-OAuth-Client-Id' id: FacebookLoginProviderPROVIDER_ID provider: 'Facebook-App-Id' id: LinkedinLoginProviderPROVIDER_ID provider: 'LINKEDIN_CLIENT_ID' ; { return CONFIG;} @
Sign in and out users
; @ implements OnInit { } : void thisauthService; : void thisauthService; : void thisauthService; : void thisauthService;
Subscribe to the authentication state
You are notified when user logs in or logs out. You receive a SocialUser
object when the user logs in and a null
when the user logs out. SocialUser
object contains basic user information such as name, email, photo URL, etc.
;; @ implements OnInit private user: SocialUser; private loggedIn: boolean; { } { thisauthServiceauthState; }
Display the user information
{{ user.name }} {{ user.email }}
Building with AoT
Contributing to project
you are welcome to report an issue or creating a pull request.