public void Impersonate(string username, string password) { try { ClientImpersonationRequest impersonateRequest = new ClientImpersonationRequest(userSecurityToken, username, password); ClientImpersonationResponse impersonateResponse = Authclient.ClientImpersonation(impersonateRequest); impersonationToken = impersonateResponse.ClientImpersonationResult; IerrorFlag = false; } catch (Exception e) { IerrorFlag = true; Iexceptionerror = e.Message; } }