Implement update authentication credential for LDAP identity sources (#516)
Signed-off-by: Dimitar Milov <dmilov@vmware.com>
This commit is contained in:
@@ -1113,7 +1113,7 @@ namespace VMware.vSphere.SsoAdminClient
|
||||
string baseDNUsers,
|
||||
string baseDNGroups,
|
||||
string authenticationUserName,
|
||||
string authenticationPassword,
|
||||
SecureString authenticationPassword,
|
||||
string serverType,
|
||||
X509Certificate2[] ldapCertificates)
|
||||
{
|
||||
@@ -1163,7 +1163,7 @@ namespace VMware.vSphere.SsoAdminClient
|
||||
new SsoAdminIdentitySourceManagementServiceAuthenticationCredentials
|
||||
{
|
||||
username = authenticationUserName,
|
||||
password = authenticationPassword
|
||||
password = SecureStringToString(authenticationPassword)
|
||||
})).Wait();
|
||||
}
|
||||
catch (AggregateException e)
|
||||
@@ -1227,6 +1227,40 @@ namespace VMware.vSphere.SsoAdminClient
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateLdapIdentitySourceAuthentication(
|
||||
string name,
|
||||
string authenticationUserName,
|
||||
SecureString authenticationPassword)
|
||||
{
|
||||
|
||||
string authenticationType = "password";
|
||||
var authorizedInvocationContext =
|
||||
CreateAuthorizedInvocationContext();
|
||||
|
||||
try
|
||||
{
|
||||
authorizedInvocationContext.
|
||||
InvokeOperation(() =>
|
||||
_ssoAdminBindingClient.UpdateLdapAuthnTypeAsync(
|
||||
new ManagedObjectReference
|
||||
{
|
||||
type = "SsoAdminIdentitySourceManagementService",
|
||||
Value = "identitySourceManagementService"
|
||||
},
|
||||
name,
|
||||
authenticationType,
|
||||
new SsoAdminIdentitySourceManagementServiceAuthenticationCredentials
|
||||
{
|
||||
username = authenticationUserName,
|
||||
password = SecureStringToString(authenticationPassword)
|
||||
})).Wait();
|
||||
}
|
||||
catch (AggregateException e)
|
||||
{
|
||||
throw e.InnerException;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<IdentitySource> GetDomains()
|
||||
{
|
||||
var authorizedInvocationContext =
|
||||
|
||||
Reference in New Issue
Block a user