3

I've created a web-app used Asp.Net with angular2. I've used a generator-aspnetcore-spa and now I would like to add identity.

I think about I can use Asp.Net Identity and use a SQL Server database to store user names, passwords, and profile data. I have some doubts about how to use Asp.Net Identity with angular2. I would like to use Asp.Net Identity as a backend service and angular2 as my client side. I've found very interesting library angular2-jwt. I think I could use Bearer Token Authentication way to implement this.

I know that angular2 does not have HttpInterceptor.

I also would like to enables users to log in using credentials from external authentication providers like facebook, google or twitter.

So could you give me some advice how can I do this or could you provide me any pieces of information, hyperlinks, online resources how can I do this?

Thanks in advance!

mskuratowski
  • 4,014
  • 15
  • 58
  • 109

1 Answers1

1

For using JWT in asp.net core, refer to the following article:

https://stormpath.com/blog/token-authentication-asp-net-core

You can use Asp.Net core identity, for storing user profile/roles data and instead of cookies use the JWT middleware Microsoft.AspNetCore.Authentication.JwtBearer to authenticate the requests.

For social login support refer to:

https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/

adnan kamili
  • 8,967
  • 7
  • 65
  • 125