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")
            };
        }

 

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