Exemplo n.º 1
0
        public IActionResult TestUserLogin()
        {
            //var userId = this.User.Claims.Where(x => x.Type == "UserId").First().Value;
            var userId = ClaimsHelper.GetUserId(this.User);
            var role   = ClaimsHelper.GetUserRole(this.User);
            //role.Value
            var types = this.User.Claims.Select(x => new
            {
                x.Value,
                name = x.Type
            }).ToList();

            return(Json(types));
        }
Exemplo n.º 2
0
 public async Task <IActionResult> GetAll()
 {
     return(Json(await this.service.GetApplications(ClaimsHelper.GetUserId(this.User), ClaimsHelper.GetUserRole(this.User))));
 }