【问题标题】:Asp.Net core identity with angular2带有 angular2 的 Asp.Net 核心标识
【发布时间】:2017-07-17 14:42:09
【问题描述】:

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

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

我知道 angular2 没有 HttpInterceptor。

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

那么您能否给我一些建议,我该如何做到这一点,或者您能否提供任何信息、超链接、在线资源,我该如何做到这一点?

提前致谢!

【问题讨论】:

    标签: angular asp.net-core asp.net-identity token angular2-jwt


    【解决方案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/

    【讨论】:

    • Stormpath API 于 2017 年 8 月 17 日关闭
    猜你喜欢
    • 1970-01-01
    • 2019-07-19
    • 2017-11-30
    • 1970-01-01
    • 2016-08-12
    • 1970-01-01
    • 2017-08-01
    • 2018-10-05
    • 2021-06-28
    相关资源
    最近更新 更多