private void SetClientCredentials(ClientCredentials clientCredentials) { this.ClientCredentials = clientCredentials ?? new ClientCredentials(); if (this.ServiceConfiguration.AuthenticationType != AuthenticationProviderType.ActiveDirectory) { return; } ServiceMetadataUtility.AdjustUserNameForWindows(this.ClientCredentials); }
/*public IdentityProvider GetIdentityProvider(string userPrincipalName) * { * return this.service.GetIdentityProvider(userPrincipalName); * }*/ /*public SecurityTokenResponse Authenticate( * ClientCredentials clientCredentials, * Uri uri, * string keyType) * { * return this.service.Authenticate(clientCredentials, uri, keyType); * } * * public SecurityTokenResponse Authenticate( * SecurityToken securityToken, * Uri uri, * string keyType) * { * return this.service.Authenticate(securityToken, uri, keyType); * }*/ private bool AdjustServiceEndpoint(Uri serviceUri) { Uri serviceUri1 = OrganizationServiceConfiguration.RemoveOrgName(serviceUri); if (serviceUri1 != (Uri)null) { this.service = new ServiceConfiguration <IOrganizationService>(serviceUri1); if (this.service != null && this.service.ServiceEndpoints != null) { foreach (KeyValuePair <string, ServiceEndpoint> serviceEndpoint in (Dictionary <string, ServiceEndpoint>) this.service.ServiceEndpoints) { ServiceMetadataUtility.ReplaceEndpointAddress(serviceEndpoint.Value, serviceUri); } return(true); } } return(false); }