Hi,
I'm building a small web app (asp.net mvc) and trying to implement a SSO connection.
So far, I'm able to connect and run my subprograms by going through a web form where the user has to enter its credentials. (I used this code to perform this : https://www.rklesolutions.com/blog/x3-soap-web-services)
I would like now to allow for the user to avoid having to type its credentials and use its own windows credentials (i'm using windows authentication in my web app). I have tried the code below but unfortunately I get an "unautorized access" error. What am I missing?
Thank you in advance for all the help you can provide.
public CAdxResultXml X3RunSubProgram(string SubProgName, string Xml)
{
CAdxResultXml resultXml = new CAdxResultXml();
CAdxWebServiceXmlCCService x3WebService = new CAdxWebServiceXmlCCService();
CAdxCallContext callContext = new CAdxCallContext();
x3WebService.Url = Properties.Settings.Default.WebServiceDouchette_CAdxWebServiceXmlCC_CAdxWebServiceXmlCCService;
ICredentials credentials = CredentialCache.DefaultNetworkCredentials;
x3WebService.Credentials = credentials;
x3WebService.UseDefaultCredentials = true;
string test = WindowsIdentity.GetCurrent().Name;
callContext.codeLang = langue;
callContext.poolAlias = poolAlias;
resultXml = x3WebService.run(callContext, SubProgName, Xml);
return resultXml;
}