on 04-07-2008 8:55 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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();
}
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.