
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
angular4-oauth-login
Advanced tools
Social login and authentication module for Angular 4. Supports authentication with **Google** and **Facebook**. Can be extended to other providers also.
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.
npm install --save angular4-oauth-login
In your AppModule, import the SocialLoginModule
import { SocialLoginModule, AuthServiceConfig } from "angular4-oauth-login";
import { GoogleLoginProvider, FacebookLoginProvider } from "angular4-oauth-login";
let config = new AuthServiceConfig([
{
id: GoogleLoginProvider.PROVIDER_ID,
provider: new GoogleLoginProvider("Google-OAuth-Client-Id", 'email picture')
},
{
id: FacebookLoginProvider.PROVIDER_ID,
provider: new FacebookLoginProvider("Facebook-App-Id")
}
]);
@NgModule({
declarations: [
...
],
imports: [
...
SocialLoginModule.initialize(config)
],
providers: [],
bootstrap: [...]
})
export class AppModule { }
import { AuthService } from "angular4-oauth-login";
import { FacebookLoginProvider, GoogleLoginProvider } from "angular4-oauth-login";
@Component({
selector: 'app-demo',
templateUrl: './demo.component.html',
styleUrls: ['./demo.component.css']
})
export class DemoComponent implements OnInit {
constructor(private authService: AuthService) { }
signInWithGoogle(): void {
this.authService.signIn(GoogleLoginProvider.PROVIDER_ID);
}
signInWithFB(): void {
this.authService.signIn(FacebookLoginProvider.PROVIDER_ID);
}
signOut(): void {
this.authService.signOut();
}
}
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.
import { AuthService } from "angular4-oauth-login";
import { SocialUser } from "angular4-oauth-login";
@Component({
selector: 'app-demo',
templateUrl: './demo.component.html',
styleUrls: ['./demo.component.css']
})
export class DemoComponent implements OnInit {
private user: SocialUser;
private loggedIn: boolean;
constructor(private authService: AuthService) { }
ngOnInit() {
this.authService.authState.subscribe((user) => {
this.user = user;
this.loggedIn = (user != null);
});
}
}
<img src="{{ user.photoUrl }}">
<div>
<h4>{{ user.name }}</h4>
<p>{{ user.email }}</p>
</div>
If you are facing issue in building your app with AoT, check this document.
npm run localdeploy
cd demo && ng serve
FAQs
Social login and authentication module for Angular 4. Supports authentication with **Google** and **Facebook**. Can be extended to other providers also.
We found that angular4-oauth-login demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.