zoukankan      html  css  js  c++  java
  • 第63章 ASP.NET Identity 支持

    提供了基于ASP.NET身份的实现,用于管理IdentityServer用户的身份数据库。此实现是IdentityServer中的扩展点,以便为用户加载身份数据以将声明发送到令牌。

    这个支持的仓储位于此处,NuGet包就在这里

    要使用此库,请正常配置ASP.NET Identity。然后在调用AddIdentityServer后使用AddAspNetIdentity扩展方法:

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddIdentity<ApplicationUser, IdentityRole>()
            .AddEntityFrameworkStores<ApplicationDbContext>()
            .AddDefaultTokenProviders();
    
        services.AddIdentityServer()
            .AddAspNetIdentity<ApplicationUser>();
    }
    

    AddAspNetIdentity需要作为通用参数,为您的用户建模ASP.NET Identity(以及传递给AddIdentityASP.NET Identity 的同一个用户)。这将配置IdentityServer使用实现IUserClaimsPrincipalFactoryIResourceOwnerPasswordValidatorIProfileService的ASP.NET Identity。它还配置了一些用于IdentityServer的ASP.NET Identity选项(例如要使用的声明类型和身份验证cookie设置)。

    github地址

  • 相关阅读:
    阿牛的EOF牛肉串
    盐水的故事
    密码
    Digital Roots
    不容易系列之(3)—— LELE的RPG难题
    不容易系列之一
    超级楼梯
    母牛的故事
    蟠桃记
    Children’s Queue
  • 原文地址:https://www.cnblogs.com/thinksjay/p/10787407.html
Copyright © 2011-2022 走看看