Angular4 Social Login
Social login and authentication module for Angular 4. Supports authentication with Google and Facebook. Can be extended to other providers also.
Forked from EasyApps Co.
Getting started
Install via npm
npm install --save angular4-oauth-login
Import the module
In your AppModule
, import the SocialLoginModule
;; let config = id: GoogleLoginProviderPROVIDER_ID provider: "Google-OAuth-Client-Id" 'email picture' id: FacebookLoginProviderPROVIDER_ID provider: "Facebook-App-Id" ; @
Sign in and out users
;; @ implements OnInit { } : 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
If you are facing issue in building your app with AoT, check this document.
Running the demo app
npm run localdeploycd demo && ng serve