Implement Set Default Identity Source and Get Default Identity Source (#545)

Signed-off-by: Dimitar Milov <dmilov@vmware.com>
This commit is contained in:
dmilov
2022-02-25 11:26:10 +02:00
committed by GitHub
parent 9a302e0473
commit 829307318f
7 changed files with 203 additions and 2 deletions

View File

@@ -1316,6 +1316,62 @@ namespace VMware.vSphere.SsoAdminClient
}
}
public void SetDefaultIdentitySource(string domainName)
{
var authorizedInvocationContext =
CreateAuthorizedInvocationContext();
var setDefaultDomainRequest = new IdS_setDefaultDomainsRequest
{
domainNames = new string[]{domainName}
};
try
{
authorizedInvocationContext.
InvokeOperation(() =>
_ssoAdminBindingClient.IdS_setDefaultDomainsAsync(
new ManagedObjectReference
{
type = "SsoAdminIdentitySourceManagementService",
Value = "identitySourceManagementService"
},
new string[]{domainName})).Wait();
}
catch (AggregateException e)
{
throw e.InnerException;
}
}
public string GetDefaultIdentitySourceDomainName()
{
string result = null;
var authorizedInvocationContext =
CreateAuthorizedInvocationContext();
try
{
var response = authorizedInvocationContext.
InvokeOperation(() =>
_ssoAdminBindingClient.IdS_getDefaultDomainsAsync(
new ManagedObjectReference
{
type = "SsoAdminIdentitySourceManagementService",
Value = "identitySourceManagementService"
})).Result;
if (response != null && response.returnval != null && response.returnval.Length > 0) {
result = response.returnval[0];
}
}
catch (AggregateException e)
{
throw e.InnerException;
}
return result;
}
public void DeleteDomain(string name)
{