How to Use External login in asp.net core web api and Angular

Alvin Bernardo 51 Reputation points
2021-07-28T06:22:16.103+00:00

Hi I have asp.net core 2.2 web api and angular version 8. One of my requirements is to create an external login using Facebook , google and Microsoft account. I know that I need to register first my application in those provider but I don't know what I should register the API or the Angular app?

How can generate token from api to angular if the facebook login is success full?

Any reference will help

Thanks a lot

Developer technologies ASP.NET ASP.NET Core
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Fei Xue - MSFT 1,111 Reputation points
    2021-07-30T01:36:21.337+00:00

    If you are using the OpenID protocol to protect your Angular app and web API, you can register one app. For the details about register on the different identity provider, you should follow the corresponding process.

    Normally, after you register the app, you will get the app info like client id, redirect URL which used in your application. Then we can use Implicit Flow to acquire the id_token for the authentication and access_token for authorization.

    Due to .NET Core 2.2 is end of support at December 23, 2019, it is recommend that you upgrade your application to the latest version. And you can refer the document below about the authentication and authorization for single page application.

    Authentication and authorization for SPAs

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.