I'm having troubles setting up a project that access to my company's clarity application. I've successfully configured a service reference (in my VisualStudio project) to the XOG I'm trying to connect to. My actual code is the following:
Auth objAuth = new Auth();
Login login = new Login();
login.Username = "mylogin";
login.Password = "mypwd";
login.TenantId = "clarity";
MyXOGQueryPortClient client = new MyXOGQueryPortClient();
string ClaritySessionID = client.Login(login);
objAuth.SessionID = ClaritySessionID;
Our clarity application have the Company's SSO configured so I've logged in to the SSO service through InternetExplorer and also inside the VisualStudio's Webbrowser. Indeed, if I connect to the clarity URL using a browser I'm NOT redirected to the SSO page.
The problem is that when the program calls client.Login()
it is returning a ProtocolException "The content type text/html of the response message does not match the content type of the binding (text/html; charset=utf-8)[...]"
. In the exception I can see the body of the page an it is the SSO redirection page.
The question is: Am I doing something wrong with the code? Can I bypass the SSO page considering that the SSO has already been done? I'm not strictly obliged to use C# (or even .NET) so, if there are solutions based on other languages, any help will be appreciated.
Thank you
I'm not very familiar with Clarity/XOG, but as it appears to be more or less a standard web service, I offer the following possibilities.
Have you tried using a xog user with the External Authentication unchecked (on the admin side), and having all the necessary xog rights ?
For more information on passing cookies with a WCF web service call, see Making web service calls with WCF client + cookies (which uses the OperationContext
).
Or you can consider using a message inspector to apply the cookie(s) to the request.
See also: