IDS4 使用数据库登录

在AccountController 中的login 方法里 验证的时候与数据库匹配

然后再实现IProfileService的方法,把Claims 对应进去。

 private Claim[] GetUserClaims()
        {
            return new Claim[]
            {
            new Claim("UserId", "1"),
            new Claim(JwtClaimTypes.Name,"test"),
            new Claim(JwtClaimTypes.GivenName, "test"),
            new Claim(JwtClaimTypes.FamilyName, "test"),
            new Claim(JwtClaimTypes.Email, "[email protected]"),
            new Claim(JwtClaimTypes.Role,"admin")
            };
        }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章