Author Topic: Cognos SDK c# - Login  (Read 3413 times)

Offline hendriklenz

  • Associate
  • **
  • Posts: 3
  • Forum Citizenship: +1/-0
Cognos SDK c# - Login
« on: 15 Apr 2009 10:03:28 am »
Hi,

i use the Cognos C# SDK. I will develop an Tool that create a List of all Reports.

I have access the the Cognos Server only via Web-Access. The Login where pass by Single-Sihn-On.
For the Single Sign On where used a special URL. When i call this URL the Login were executing and i can Start Cognos.

I can not use the example Logon of the SDK Sample because i must use this special Single-Sign On over the URL.

How can i perform the Login over the URL with the SDK and C#?

The Logon Url is:
http://agree-analysen-login.enterprise.fiducia.de/

And the COGNOS URL is:
http://agree-analysen.enterprise.fiducia.de/crn/cgi-bin/mod2_cognos.dll

When i don“t use the Logon URL and start COGOS directly the Browser show an Login Form. But i can not use the Login Form to log me in because there are some other Things that were done when the login perfom over the URL.

Thanks
Hendrik

Offline netanel

  • Full Member
  • ***
  • Posts: 12
  • Forum Citizenship: +0/-0
Re: Cognos SDK c# - Login
« Reply #1 on: 19 Apr 2009 01:04:17 am »
Hi.
It seems that when you login via your URL you create a Cognos passport, but you lose it when you connect to Cognos and that's why you are prompted to log in. Try to retrieve the CAMID from your application and pass it to Cognos when connecting.

Offline hendriklenz

  • Associate
  • **
  • Posts: 3
  • Forum Citizenship: +1/-0
Re: Cognos SDK c# - Login
« Reply #2 on: 27 Apr 2009 03:26:31 am »
Hi,

thank you for the answer.

How can i get the CAMID from the single sign on via webbrowser?
And how can i use the camid with the c# cognos login?

thanks for your hints.

hendrik

Offline netanel

  • Full Member
  • ***
  • Posts: 12
  • Forum Citizenship: +0/-0
Re: Cognos SDK c# - Login
« Reply #3 on: 27 Apr 2009 04:50:21 am »
Actually, I believe your URL enables authentication only against your LDAP (and Cognos is configured to use Single-SignOn). Where it takes the credentials from - a cookie? the URL? Any how, you need to retrieve them from your authentication page, and then pass them to Cognos login (wrapped as XML of course).
I hope I understand the situation correctly...

Offline hendriklenz

  • Associate
  • **
  • Posts: 3
  • Forum Citizenship: +1/-0
Re: Cognos SDK c# - Login
« Reply #4 on: 27 Apr 2009 09:23:26 am »
Hi,

i think the id saved in a cookie.

I found a cookie with the name "cam_passport" after i do an logon.
The cookie has this value:
101:b0c8f97d-1be7-6ab2-6c3a-f91102d8faa4:1606591855

How can i translate it to the logon code for c# (the xml-file)?

Thanks
Hendrik

Offline netanel

  • Full Member
  • ***
  • Posts: 12
  • Forum Citizenship: +0/-0
Re: Cognos SDK c# - Login
« Reply #5 on: 04 May 2009 03:16:04 am »
Put it inside the header of the service you use.
For example, if you use an istance of contentManagerService1 called c8cms, put the id you have in
c8cms.biBusHeaderValue.CAM.CAMPassport.id

Offline dotnetcognosdeveloper

  • Associate
  • **
  • Posts: 1
  • Forum Citizenship: +0/-0
    • Cognos for .Net Developers
Re: Cognos SDK c# - Login
« Reply #6 on: 17 May 2009 08:57:38 pm »
Hi Hendrik,

Don't know if you solved this? If not, reply to this post or shoot me an email. I think I can help you out.

Cheers!

Offline amitmca

  • Associate
  • **
  • Posts: 4
  • Forum Citizenship: +0/-0
Re: Cognos SDK c# - Login
« Reply #7 on: 05 Jan 2011 05:07:36 am »
Hi dotnetcognosdeveloper,

I am having the same issue. I do not know how to authenticate or login in ContentManagerService using Single SignOn. I am using C# and developing an app to query the Content Store

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Posts: 831
  • Forum Citizenship: +61/-40
  • Creator of the Impact Suite
    • The Impact Suite
Re: Cognos SDK c# - Login
« Reply #8 on: 06 Jan 2011 05:09:02 am »
AFAIK: For the SDK to have SSO capabilities you have to create a web request using the Gateway URI.
From that webrequest you have to get the passport ID and set this in the BIBUSHeader Passport Id.

Offline amitmca

  • Associate
  • **
  • Posts: 4
  • Forum Citizenship: +0/-0
Re: Cognos SDK c# - Login
« Reply #9 on: 11 Jan 2011 03:11:37 am »
Does that mean, I have to send a web request to the SSO enable URL using C# code. If so, does it return the PASSPORT ID in the Web Response? Thank you.

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Posts: 831
  • Forum Citizenship: +61/-40
  • Creator of the Impact Suite
    • The Impact Suite
Re: Cognos SDK c# - Login
« Reply #10 on: 11 Jan 2011 06:05:40 am »
yep... that's what I would do... Pass a request to the gateway and read the response...

Offline amitmca

  • Associate
  • **
  • Posts: 4
  • Forum Citizenship: +0/-0
Re: Cognos SDK c# - Login
« Reply #11 on: 11 Jan 2011 06:46:46 am »
Hi.. thanks for your response. I tried to send a web request but it gave me the error 'The remote server returned an error: (401) Unauthorized.' I have been stuck on this for so long and can not find the solution. There must be a way to logon using sso. If I type the same URL on the browser, it logs me in straight away but do not know how to do it using SDK...

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Posts: 831
  • Forum Citizenship: +61/-40
  • Creator of the Impact Suite
    • The Impact Suite
Re: Cognos SDK c# - Login
« Reply #12 on: 11 Jan 2011 07:48:40 am »
Did you pass it to the gateway (cognos8/cgi-bin/cognosisapi.dll)or the dispatcher(...:9300/p2pd/...)
Read the following:
https://www-304.ibm.com/support/docview.wss?uid=swg21343956
« Last Edit: 11 Jan 2011 07:51:45 am by ReportNet Addict »

Offline amitmca

  • Associate
  • **
  • Posts: 4
  • Forum Citizenship: +0/-0
Re: Cognos SDK c# - Login
« Reply #13 on: 11 Jan 2011 07:55:47 am »
Hi,

I passed it to the gateway. http://xxxx.co.uk/cognos8/cgi-bin-ss/cognosisapi.dll. cgi-bin-ss is configured for single signon. It works fine from the browser but when I try it using HttpWebRequest class using code. It throws that exception.

Amit

Offline ReportNet Addict

  • Global Moderator
  • Statesman
  • *****
  • Posts: 831
  • Forum Citizenship: +61/-40
  • Creator of the Impact Suite
    • The Impact Suite
Re: Cognos SDK c# - Login
« Reply #14 on: 23 Jan 2011 03:52:18 pm »
Have you read the provided url?