skip to Main Content

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


  1. 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:

    1. You can use generated button.
    2. You can use Facebook API for REST requests.

    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/

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search