Al tratar de conectarse al servicio de Core me sale el siguiente error:Tridion Servicio Core 2011: No se puede conectar en un entorno de SSO
The HTTP request was forbidden with client authentication scheme 'Anonymous'
El entorno Tridion está configurado con SSO de SiteMinder.
Aquí está mi código:
public static ICoreService2010 GetTridionClient()
{
var binding = new BasicHttpBinding()
{
Name = "BasicHttpBinding_TridionCoreService",
CloseTimeout = new TimeSpan(0, 1, 0),
OpenTimeout = new TimeSpan(0, 1, 0),
ReceiveTimeout = new TimeSpan(0, 10, 0),
SendTimeout = new TimeSpan(0, 1, 0),
AllowCookies = false,
BypassProxyOnLocal = false,
HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
MaxBufferSize = 4194304, // 4MB
MaxBufferPoolSize = 4194304,
MaxReceivedMessageSize = 4194304,
MessageEncoding = WSMessageEncoding.Text,
TextEncoding = System.Text.Encoding.UTF8,
TransferMode = TransferMode.Buffered,
UseDefaultWebProxy = true,
ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas()
{
MaxDepth = 32,
MaxStringContentLength = 4194304, // 4MB
MaxArrayLength = 4194304,
MaxBytesPerRead = 4194304,
MaxNameTableCharCount = 16384
},
Security = new BasicHttpSecurity()
{
Mode = BasicHttpSecurityMode.TransportCredentialOnly,
Transport = new HttpTransportSecurity()
{
ClientCredentialType = HttpClientCredentialType.None,
},
Message = new BasicHttpMessageSecurity()
{
ClientCredentialType = BasicHttpMessageCredentialType.UserName
}
}
};
string hostname = ConfigurationManager.AppSettings["TridionUrl"];
string username = ConfigurationManager.AppSettings["TridionUsername"];
hostname = string.Format("{0}{1}{2}",
hostname.StartsWith("http") ? "" : "http://",
hostname,
hostname.EndsWith("/") ? "" : "/");
var endpoint = new EndpointAddress(hostname +
"/webservices/CoreService.svc/basicHttp_2010");
var factory = new ChannelFactory<ICoreService2010>(binding, endpoint);
factory.Credentials.UserName.UserName = username;
return factory.CreateChannel();
}
¿Alguien tiene experiencia de interactuar con el Servicio básico con un tipo de autenticación que no sea Windows?
ACTUALIZACIÓN:
ahora consigo el error:
The HTTP request was forbidden with client authentication scheme 'Basic'.
Lo clientCredentialType se debe utilizar en el /webservices/web.config para los enlaces?
Cuando elimino el comentario del SsoAgentHttpModule en /webservies/web.config, obtenemos un error de 500 en el servicio web, por lo que SDL nos dijo que dejáramos este comentario.
¿Debo entender que este módulo es necesario para que CoreService se autentique con el esquema de autenticación 'Básico'?
No es necesario descomentar SsoAgentHttpModule en /webservices/web.config ya que lo ha descomentado en la configuración raíz y se ha propuesto para todo el sitio web. ¿Estás seguro de que te estás conectando a la URL correcta (SSO)? –