Ejemplo n.º 1
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     if (ValidateControls())
     {
         PasswordResetDto = new PasswordResetRequestDto {
             NewPassword = txtPassword.Text
         };                                                                               //, CurrentPassword = TxtCurrentPassword.Text };
         DialogResult = DialogResult.OK;
     }
     else
     {
         DialogResult = DialogResult.None;
     }
 }
Ejemplo n.º 2
0
        public UserDto UpdatePassword(ServerDto serverDto, string tenantName, UserDto user, PasswordResetRequestDto requestDto, Token token)
        {
            var upn = Uri.EscapeDataString(user.Name + "@" + user.Domain);

            tenantName = Uri.EscapeDataString(tenantName);
            var json = JsonConvert.Serialize(requestDto);
            var url  = ServiceConfigManager.UpdatePasswordUrl(serverDto, tenantName, upn);

            ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); };
            var requestConfig = new RequestSettings
            {
                Method = HttpMethod.Put,
            };
            var headers = ServiceHelper.AddHeaders(ServiceConfigManager.JsonContentType);

            json = "access_token=" + token.AccessToken + "&token_type=" + token.TokenType.ToString().ToLower() + "&" + json;
            var result = _webRequestManager.GetResponse(url, requestConfig, headers, null, json);

            return(JsonConvert.Deserialize <UserDto>(result));
        }