I’m trying to develop a facebook authentication using Angular7 and .net core API. I need to open the facebook authentication window and then communicate the access token to the backend API. To open the facebook popup I’m supposed to use the facebook provider?”
signInWithFB(): void {
this.authService.signIn(FacebookLoginProvider.PROVIDER_ID).then(x =>
console.log(x));
}
2
Answers
This helped me. Or you can generate login button from here.
First of all you need create application in your Facebook developer account by using generated application token, you can generate access token.
There are several ways to login in Facebook:
To solve error when run launchFbLogin, you need add to field “App Domains” value “localhost” in Basic Settings.
And maybe add to Facebook Login product in field “Valid OAuth Redirect URIs” HTTPS URL of localhost. For example: “https://localhost:5000/“
The easy way to do this is to use the angularx-social-login npm package. This support different version of angular. Its easy to use and fast o integrate.