Exemplo n.º 1
0
        public ActionResult List()

        {
            ScimService  scimService = new ScimService();
            var          result      = scimService.UsersLIst();
            List <Users> userList    = new List <Users>();

            userList.Add(result);
            return(View(userList));
        }
Exemplo n.º 2
0
        public ActionResult UpdateProfile()
        {
            UserProfileView userProfileView = new UserProfileView();
            string          inum            = User.Claims.Where(p => p.Type == "inum").Select(o => o.Value).FirstOrDefault();

            userProfileView.Active  = true;
            userProfileView.Schemas = new List <string>();
            userProfileView.Schemas.Add("urn:ietf:params:scim:schemas:core:2.0:User");
            ScimService scimService = new ScimService();
            var         result      = scimService.UsersProfile(inum, userProfileView);

            return(View(result));
        }
Exemplo n.º 3
0
 public IActionResult UpdateProfile(UserProfileView userProfileView)
 {
     if (ModelState.IsValid)
     {
         var    password = User.Claims.Where(p => p.Type == "password").Select(o => o.Value).FirstOrDefault();
         string inum     = User.Claims.Where(p => p.Type == "inum").Select(o => o.Value).FirstOrDefault();
         userProfileView.Active  = true;
         userProfileView.Schemas = new List <string>();
         userProfileView.Schemas.Add("urn:ietf:params:scim:schemas:core:2.0:User");
         userProfileView.Password = password;
         ScimService scimService = new ScimService();
         var         result      = scimService.UpdateProfile(inum, userProfileView);
         TempData["message"] = "Updated Sucessfully";
         return(RedirectToAction("UserApplications", "Application"));
     }
     return(View());
 }
Exemplo n.º 4
0
        public IActionResult ChangePassword(PasswordView passwordView)
        {
            string inum = User.Claims.Where(p => p.Type == "inum").Select(o => o.Value).FirstOrDefault();

            if (ModelState.IsValid)
            {
                UserPassword password = new UserPassword();
                password.Active  = true;
                password.Schemas = new List <string>();
                password.Schemas.Add("urn:ietf:params:scim:schemas:core:2.0:User");
                password.Password = passwordView.Password;
                ScimService scimService = new ScimService();
                var         result      = scimService.ChangePassword(inum, password);
                TempData["message"] = "Your Password Changed Sucessfully";
                return(RedirectToAction("UserApplications", "Application"));
            }
            return(View());
        }