Hello,
I am developing service that is connecting to Documentum 6.6 and getting documents etc. Right now I am trying to connect to services using Kerberos authentication but I have problem with getting kerberos ticket. My code looks like this:
IServiceContext serviceContext;
ISearchService searchService;
ContextFactory contextFactory = ContextFactory.Instance;
serviceContext = contextFactory.NewContext();
ServiceFactory serviceFactory = ServiceFactory.Instance;
KerberosTokenHandler handler = new KerberosTokenHandler();
String servicePrincipalName = "DFS/documetum66"; // this is the service principal name for your DFS service account in Active Directory.
using (KerberosClientContext kerberosClientContext = new KerberosClientContext(servicePrincipalName, true, ImpersonationLevel.Delegation))
{
KerberosBinarySecurityToken token = new KerberosBinarySecurityToken(kerberosClientContext.InitializeContext(), KerberosValueType.KERBEROSV5_AP_REQ);
handler.SetBinarySecurityToken(token);
List<IEndpointBehavior> handlers = new List<IEndpointBehavior>();
handlers.Add(handler);
handler.SetBinarySecurityToken(new KerberosBinarySecurityToken(kerberosClientContext.InitializeContext(), KerberosValueType.GSS_KERBEROSV5_AP_REQ));
searchService = serviceFactory.GetRemoteService<ISearchService>(serviceContext, "search",
settings.Address + "/services", handlers);
}
but the kerberosClientContext.InitializeContext() is throwing exception: WSE594: InitializeSecurityContext call failed with the following error message: An internal error occurred.
Does anybody tried to Invoke services using Kerberos and had similar issue or know the reason why it can happen ?
Regards,
Michal Jedrzejewski