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