on 02-01-2017 10:05 PM - last edited on 02-03-2024 8:07 PM by postmig_api_4
Our company uses SSO to netweaver. I have a .net c# web application that is running on a different IIS server than netweaver that has to somehow programmatically get a SAP Logon Ticket string. I've downloaded the SAP .NET Conector 3.0 (2 DLLs) off of github, but don't see any methods to get a Logon Ticket.
Please let me know how I can accomplish this. Thanks!
Got it!
var request = (HttpWebRequest)WebRequest.Create(urlToPortal);
request.CookieContainer = newCookieContainer();
request.MaximumAutomaticRedirections = 4;
request.MaximumResponseHeadersLength = 4;
request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse) request.GetResponse();
model.RequestedEvent = response.StatusCode.ToString();
foreach (Cookie cook in response.Cookies)
{
if (cook.Name == "MYSAPSSO2")
{
model.SAPLoginTicket = cook.Value;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Matt! I've gotten the login ticket from the browser cookie using C# and a HttpRedirect, but had to hard code user id and password. I need to be able to do this without providing a user id and password. Can anyone show me some code on how to accomplish this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.