cancel
Showing results for 
Search instead for 
Did you mean: 

Using .Net Connector to retrieve user id from MYSAPSSO2

Former Member
0 Kudos

I am trying to get the user id from the MYSAPSSO2 cookie from my .net application that is running through EP6.

So far I have the following code most of it taken from the artical "Enabling Single Sign-On for ASP.NET Applications in Enterprise Portal 6:

SAP.Connector.Destination dest = new SAP.Connector.Destination();

dest.MySAP_SSO2 = HttpUtility.UrlDecode(this.Request.Cookies["MYSAPSSO2"].Value);

string TheCookie;

TheCookie = dest.MySAP_SSO2.ToString();

Response.Write(TheCookie);

My question is, what code do I use from here to get the user id from the jumbled string that is returned?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I understood that you didn't need it for that. In the article:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/edb8a190-0201-0010-d398-c23...

It says:

You want to use the portal SSO to connector with SAP .NET Connector: In fact you don’t need the .NET Ticket Toolkit for this, because the SAP .NET Connector supports the MySAPSSSO2 ticket directly. You only need to UrlDecode the cookie string:

SAP.Connector.Destination dest = new SAP.Connector.Destination();

// set other properties here

dest.MySAP_SSO2 = HttpUtility.UrlDecode(this.Request.Cookies["MYSAPSSO2"].Value);

reiner_hille-doering
Active Contributor
0 Kudos

You don't need the ticket toolkit if you just want to use the SAP Logon Ticket to connect with an ABAP backend using the .NET Connector.

But I understood that your main issue is to read the user name from the ticket (and maybe also check if the ticket is valid). For this you need the ticket toolkit.

reiner_hille-doering
Active Contributor
0 Kudos

The user name ist encrypted indide of the ticket string. To read it you need the Ticket Toolkit or something equivalent.