cancel
Showing results for 
Search instead for 
Did you mean: 

PDK and SSO

Former Member
0 Kudos

Hello,

I need to call sap connector to get data from SAP back end system.

The problem is that I don't want to hard-code user id and password to

a given user; instead, I want to use Single Sign In feature of SAP EP.

Please advise how to use SSO instead of hard coding a connection to a specific user id and password. Here is my code:


// Below connection is hard-coded
// Question is: How to make a login to appHost using SSO
SAPProxy1 proxy = new 
  SAPProxy1("ASHOST=appHost SYSNR=00 " +
              "CLIENT=021 USER=userid PASSWD=" + 
              "password");

Thanks in advance,

Ali.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

based on the documentation from SAP the following SSO technolgies can be used by the NCo:

- Kerberos

- NTLM

- X.509

- Microsoft Passport

- SAPSSO2

- SAPLoginForm User name and password authentication

- SAPSSO1

Check the Destination class from more information. I can send you also the documentation if you want.

- Juergen

Former Member
0 Kudos

Thanks Juergen. Can you tell me how to know which SSO technology

we are using? After that I need to know how to use NCo with the destination techs please.

Thanks,

Ali.

Former Member
0 Kudos

I assume you are using MySAP_SSO2 (The newer SAP Logon ticket used by the

Enterprise Portal)

Former Member
0 Kudos

I'm not sure. Please advise how to check which SSO technology is used?

rima-sirich
Advisor
Advisor
0 Kudos

Hi Ali,

I think that the code should be pretty similar to this [ASP .NET sample|http://help.sap.com/saphelp_nw04/helpdata/en/51/d5470940fd564b888f4beb9523fa6c/content.htm]


SAPProxy1 proxy = new SAPProxy1();
proxy.Connection = SAP.Connector.SAPLoginProvider.GetSAPConnection(this);

From [SAPLoginProvider|http://help.sap.com/saphelp_nw04/helpdata/en/3c/0efe7b60b9ce40acd2c0b10d7480db/content.htm] description follows that it provides an alternative single sign-on capability.

Regards,

Rima.

Former Member
0 Kudos

Thank you Jurgan & Rima, as you both directed me to find the

solution. For the sake of documentation, I'm posting the code which worked with me (we are using MYSAPSSO2):


// This example is using RFC_READ_TABLE
// to read the first 5 rows from EKKO table		
SAP.Connector.Destination d = 
	new SAP.Connector.Destination();
// define all connection parameters except credentials
d.SystemNumber = 0;
d.AppServerHost = "devApphost";
d.Client = 800;
d.Language= "EN";
// use SSO instead of hardcoded user id & password
d.MySAP_SSO2 = 
	this.Request.Cookies.Get("MYSAPSSO2").Value;
SAPProxy1 p = new SAPProxy1();
p.Connection = 
	SAP.Connector.SAPLoginProvider.GetSAPConnection(this.Page, d);
try 
{				
	TAB512Table data = new TAB512Table();
	RFC_DB_FLD fld = new RFC_DB_FLD();
	fld.Fieldname = "EBELN";
	fld.Length = "10";
	fld.Type = "C";
	RFC_DB_FLDTable t = new RFC_DB_FLDTable();
	t.Add(fld);
	RFC_DB_OPTTable op =new RFC_DB_OPTTable();
	p.Rfc_Read_Table("","", "EKKO", 5,0, ref data, ref t, ref op);
	DataTable dt = data.ToADODataTable();
	for (int i=0; i<dt.Rows.Count; i++)
		Write(dt.Rows<i>[0].ToString() + "<br/>");
} 
catch (Exception x) 
{
	Write(x.ToString());

}
finally 
{
	p.Connection.Close();
}

Answers (0)