3

我用 angular2 创建了一个使用 Asp.Net 的网络应用程序。我使用了generator-aspnetcore-spa,现在我想添加身份。

我想我可以使用 Asp.Net Identity 并使用 SQL Server 数据库来存储用户名、密码和配置文件数据。我对如何将 Asp.Net Identity 与 angular2 一起使用有些疑问。我想使用 Asp.Net Identity 作为后端服务,使用 angular2 作为我的客户端。我发现了非常有趣的库angular2-jwt。我想我可以使用承载令牌身份验证方式来实现这一点。

我知道 angular2 没有 HttpInterceptor。

我还想让用户使用来自外部身份验证提供商(如 facebook、google 或 twitter)的凭据登录。

那么你能给我一些建议,我该怎么做,或者你能给我提供任何信息、超链接、在线资源,我该怎么做?

提前致谢!

4

1 回答 1

1

在 asp.net core 中使用 JWT,请参考以下文章:

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

您可以使用 Asp.Net 核心身份来存储用户配置文件/角色数据,而不是使用 JWT 中间件Microsoft.AspNetCore.Authentication.JwtBearer对请求进行身份验证。

有关社交登录支持,请参阅:

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

于 2017-02-27T05:03:30.107 回答