All Projects → abacritt → Angularx Social Login

abacritt / Angularx Social Login

Licence: mit
Social login and authentication module for Angular 9

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Angularx Social Login

Argus Android
Login/Registration Module for Android
Stars: ✭ 89 (-79.86%)
Mutual labels:  social-login, facebook-login, google-login
KASocialLogins
This is Social login library in which you can login through Facebook , LinkedIn and Google
Stars: ✭ 15 (-96.61%)
Mutual labels:  facebook-login, google-login, social-login
Simpleauth
A easy to use social authentication android library. (Facebook, Google, Twitter, Instagram)
Stars: ✭ 216 (-51.13%)
Mutual labels:  social-login, facebook-login, google-login
Socialloginmanager
DEPRECATED
Stars: ✭ 178 (-59.73%)
Mutual labels:  social-login, facebook-login, google-login
angular5-social-login
Social authentication module for Angular 5. Includes Facebook and Google login with AOT compatibility.
Stars: ✭ 40 (-90.95%)
Mutual labels:  facebook-login, google-login, social-login
Spring Boot React Oauth2 Social Login Demo
Spring Boot React OAuth2 Social Login with Google, Facebook, and Github
Stars: ✭ 676 (+52.94%)
Mutual labels:  social-login, facebook-login, google-login
social-auth-kivy
Integrate Google, Facebook, Github & Twitter login in kivy applications
Stars: ✭ 133 (-69.91%)
Mutual labels:  facebook-login, google-login, social-login
Nest Angular
NestJS, Angular 6, Server Side Rendering (Angular Universal), GraphQL, JWT (JSON Web Tokens) and Facebook/Twitter/Google Authentication, Mongoose, MongoDB, Webpack, TypeScript
Stars: ✭ 307 (-30.54%)
Mutual labels:  facebook-login, google-login
SimpleOAuth
Simple OAuth 2.0 for Android
Stars: ✭ 15 (-96.61%)
Mutual labels:  facebook-login, google-login
spring-boot-jwt-social-auth
Implementing JWT authentication and integrate Facebook login with it using Spring Boot
Stars: ✭ 32 (-92.76%)
Mutual labels:  facebook-login, social-login
Pwa Auth
Web component that lets your users sign-in/sign-up using their Microsoft, Google, Facebook, or Apple account. Your app receives their email address, name, and profile picture.
Stars: ✭ 139 (-68.55%)
Mutual labels:  facebook-login, google-login
Vue-Facebook-Google-oAuth
SignIn or Signup with Facebook and Google using Vue without any external packages
Stars: ✭ 68 (-84.62%)
Mutual labels:  facebook-login, social-login
TinderBotz
Automated Tinder bot and scraper using selenium in python.
Stars: ✭ 265 (-40.05%)
Mutual labels:  facebook-login, google-login
Magento 2 Social Login
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
Stars: ✭ 156 (-64.71%)
Mutual labels:  social-login, facebook-login
Bon Voyage
A Hotel booking Android application. This app consists of a Google, Facebook and email login. Firebase is used as the database. The user can select the destination, select the hotel, and book the rooms there. After the booking process is complete, a confirmation email is sent to the user.
Stars: ✭ 19 (-95.7%)
Mutual labels:  facebook-login, google-login
LeonSocialLogin
Leon Social Login is an Android library written to Integrate (Twitter, Facebook, Google, SnapChat) login.
Stars: ✭ 16 (-96.38%)
Mutual labels:  facebook-login, social-login
React Most Wanted
React starter kit with "Most Wanted" application features
Stars: ✭ 1,867 (+322.4%)
Mutual labels:  facebook-login, google-login
nest-angular-auth-client
Angular client for NestJS authentication (Login, Register, Google Login, Facebook Login, Apple Login, Messages, Rooms, Private DMs)
Stars: ✭ 16 (-96.38%)
Mutual labels:  facebook-login, google-login
socialApp-MERN
Social Networking web app similar to Instagram.
Stars: ✭ 35 (-92.08%)
Mutual labels:  google-login, social-login
worker-auth-providers
worker-auth-providers is an open-source providers to make authentication easy with workers. Very lightweight script which doesn't need a lot of dependencies. Plug it with any framework or template of workers.
Stars: ✭ 85 (-80.77%)
Mutual labels:  facebook-login, google-login

Angular Social Login

Gitter

Social login and authentication module for Angular 9+. Supports authentication with Google, Facebook, Amazon, and VK out of the box. Can be extended to other providers also.

Check out the demo.

Note: For compatibility with older versions Angular (e.g. Angular 8 and older), please use an older version of the library. Check this comment on the compatibility with Angular versions and this comment on how to use the older version of the library.

Getting started

Install via npm

npm i angularx-social-login

Import the module

In your AppModule, import the SocialLoginModule

import { SocialLoginModule, SocialAuthServiceConfig } from 'angularx-social-login';
import {
  GoogleLoginProvider,
  FacebookLoginProvider
} from 'angularx-social-login';

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...
    SocialLoginModule
  ],
  providers: [
    {
      provide: 'SocialAuthServiceConfig',
      useValue: {
        autoLogin: false,
        providers: [
          {
            id: GoogleLoginProvider.PROVIDER_ID,
            provider: new GoogleLoginProvider(
              'clientId'
            )
          },
          {
            id: FacebookLoginProvider.PROVIDER_ID,
            provider: new FacebookLoginProvider('clientId')
          }
        ]
      } as SocialAuthServiceConfig,
    }
  ],
  bootstrap: [...]
})
export class AppModule { }

Sign in and out users

import { SocialAuthService } from "angularx-social-login";
import { FacebookLoginProvider, GoogleLoginProvider } from "angularx-social-login";

@Component({
  selector: 'app-demo',
  templateUrl: './demo.component.html',
  styleUrls: ['./demo.component.css']
})
export class DemoComponent implements OnInit {

  constructor(private authService: SocialAuthService) { }

  signInWithGoogle(): void {
    this.authService.signIn(GoogleLoginProvider.PROVIDER_ID);
  }

  signInWithFB(): void {
    this.authService.signIn(FacebookLoginProvider.PROVIDER_ID);
  }

  signOut(): void {
    this.authService.signOut();
  }

}

Refresh google Auth Token

Once a user is logged in manual refresh token method can be triggered

import { SocialAuthService } from "angularx-social-login";
import { GoogleLoginProvider } from "angularx-social-login";

@Component({
  selector: 'app-demo',
  templateUrl: './demo.component.html',
  styleUrls: ['./demo.component.css']
})
export class DemoComponent implements OnInit {

  constructor(private authService: SocialAuthService) { }

  refreshToken(): void {
    this.authService.refreshAuthToken(GoogleLoginProvider.PROVIDER_ID);
  }

}

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. along with the auth_token. You can communicate the auth_token to your server to authenticate the user in server and make API calls from server.

import { SocialAuthService } from "angularx-social-login";
import { SocialUser } from "angularx-social-login";

@Component({
  selector: 'app-demo',
  templateUrl: './demo.component.html',
  styleUrls: ['./demo.component.css']
})
export class DemoComponent implements OnInit {

  user: SocialUser;
  loggedIn: boolean;

  constructor(private authService: SocialAuthService) { }

  ngOnInit() {
    this.authService.authState.subscribe((user) => {
      this.user = user;
      this.loggedIn = (user != null);
    });
  }

}

Display the user information

<img src="{{ user.photoUrl }}">
<div>
  <h4>{{ user.name }}</h4>
  <p>{{ user.email }}</p>
</div>

Specifying custom scopes, fields etc. on initialization

const fbLoginOptions = {
  scope: 'pages_messaging,pages_messaging_subscriptions,email,pages_show_list,manage_pages',
  return_scopes: true,
  enable_profile_selector: true
}; // https://developers.facebook.com/docs/reference/javascript/FB.login/v2.11

const googleLoginOptions = {
  scope: 'profile email'
}; // https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2clientconfig

const vkLoginOptions = {
  fields: 'photo_max,contacts', // Profile fields to return, see: https://vk.com/dev/objects/user
  version: '5.124', // https://vk.com/dev/versions
}; // https://vk.com/dev/users.get

let config = [
  {
    id: GoogleLoginProvider.PROVIDER_ID,
    provider: new GoogleLoginProvider("Google-OAuth-Client-Id", googleLoginOptions)
  },
  {
    id: FacebookLoginProvider.PROVIDER_ID,
    provider: new FacebookLoginProvider("Facebook-App-Id", fbLoginOptions)
  },
  {
    id: VKLoginProvider.PROVIDER_ID,
    provider: new VKLoginProvider("VK-App-Id", vkLoginOptions)
  },
];

Specifying custom scopes, fields etc. on login

const fbLoginOptions = {
  scope: 'pages_messaging,pages_messaging_subscriptions,email,pages_show_list,manage_pages'
}; // https://developers.facebook.com/docs/reference/javascript/FB.login/v2.11

this.authService.signIn(FacebookLoginProvider.PROVIDER_ID, fbLoginOptions);

Providers

Provider Documentation
MicrosoftLoginProvider Link

Running the demo app

ng build lib
ng serve
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].