question

AlvinBernardo-6369 avatar image
0 Votes"
AlvinBernardo-6369 asked FeiXue-MSFT edited

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

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

dotnet-aspnet-core-webapi
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

FeiXue-MSFT avatar image
0 Votes"
FeiXue-MSFT answered FeiXue-MSFT edited

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


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.