John Polito is emailing me the code and I will post it as an attachment.
If I follow the suggestion of this topic, the url http://server.domain.com:####/lawson/portal/ I don't get any cookie at all.
After I trace the http traffic from Internet Explorer what I found is http://server.domain.com:...ig/SSOCfgInfoServlet does return the JSESSIONID cookie.
I'm still unable to get the C.LWSN cookie which is given after successful authentication. It's weird it work for you and It doesn't to me, Lawson is on AS400 environment, I don't know if that makes a difference, I wouldn't expect it. Any Ideas?
adefunke, this is how it was done in an interface we have for Lawson 8: Dim http As String = "http://mccaina:10101/cgi-lawson/dme.exe?PROD=L80PDSAF&FILE=GLSYSTEM&FIELD=ACCT-PERIOD;Fiscal-Year&SELECT=COMPANY=220&OUT=CSV&DELIM=|&NOHEADER"
Dim webrequest As System.Net.HttpWebRequest = CType(System.Net.WebRequest.Create(http), HttpWebRequest) Dim myCred As NetworkCredential = New NetworkCredential(My.Resources.USER, My.Resources.PASSWORD, "") webrequest.Credentials = myCred
Dim webresponse As System.Net.HttpWebResponse = CType(webrequest.GetResponse(), HttpWebResponse)
Finaly is working, thanks to all of you for your useful posts, basicaly .net was putting an additional header which we have to get ride off, the header is '100-continue', after that the code suggested works just fine. Posted By vb on 10/05/2009 01:32 PM If I follow the suggestion of this topic, the url http://server.domain.com:####/lawson/portal/ I don't get any cookie at all. After I trace the http traffic from Internet Explorer what I found is http://server.domain.com:...ig/SSOCfgInfoServlet does return the JSESSIONID cookie. I'm still unable to get the C.LWSN cookie which is given after successful authentication. It's weird it work for you and It doesn't to me, Lawson is on AS400 environment, I don't know if that makes a difference, I wouldn't expect it. Any Ideas?
@vb, sorry, double posted. site's moving slow today.
Posted By PaulJ on 10/08/2009 08:20 AM @vb, I'm trying to do something similar, in that from asp.net vb.net i'm trying to simply see if a user is already logged in to Lawson, so that when they link to our vb.net site, it'll bypass our login form. Could you email me the vb.net code you're using to query data out of lawson? I'm also not able to find the C.LWSN cookie. I know I'm close, just not sure what exactly i'm doing wrong. passing on your code to me would be a HUGE help. Thanks.
I'm not quite sure what you are looking for but I attached the code, it may give you some ideas. Let me know how that goes.
I have adjust the code to get ride of private information within the code. Keep in mind the error handling because it can be very fuzzy.
*The example code is not closing propperly the response object which should, so keep it in mind if you were not aware.
Thanks. Haven't had a chance to try it quite yet. What I am meaning is, say I have a user, John Doe.
John Doe logs into Lawson through the Lawson portal page. Once logged in, he clicks on a shortcut link that opens a new browser window and navigates to our .NET application website. I want the .NET application site to ask Lawson whether the user has already logged in to Lawson or not. Basically, we want to make it so if the user is in fact already logged into Lawson, that it will take them straight into our application without making the user have to relogin through the .NET application's login form.
In your example, it looks like you're taking what a user types in as a username and password and actually authenticating with it to Lawson through the Http web request via POST. I don't want to do this; instead I simply want to ask Lawson, via an http web request, if the user who is navigating to our .NET page has already authenticated with Lawson.
Does this make more sense?
Posted By PaulJ on 10/09/2009 01:58 PM Thanks. Haven't had a chance to try it quite yet. What I am meaning is, say I have a user, John Doe. John Doe logs into Lawson through the Lawson portal page. Once logged in, he clicks on a shortcut link that opens a new browser window and navigates to our .NET application website. I want the .NET application site to ask Lawson whether the user has already logged in to Lawson or not. Basically, we want to make it so if the user is in fact already logged into Lawson, that it will take them straight into our application without making the user have to relogin through the .NET application's login form. In your example, it looks like you're taking what a user types in as a username and password and actually authenticating with it to Lawson through the Http web request via POST. I don't want to do this; instead I simply want to ask Lawson, via an http web request, if the user who is navigating to our .NET page has already authenticated with Lawson. Does this make more sense?
Sure it does, what you are looking for is called 'single sign on' which I know for a fact Lawson fully support, my suggestion to you is find out if the other web app you refer to is 'single sign on' capable and then turn both on, in such case you wouldn't have to do more than actually put the 'link' you mentioned before.
Single sign on is a configuration matter rather than a coding thing unless your other application doesn't support it. I hope this helps you a little bit more.
Posted By vb on 10/09/2009 02:23 PM Sure it does, what you are looking for is called 'single sign on' which I know for a fact Lawson fully support, my suggestion to you is find out if the other web app you refer to is 'single sign on' capable and then turn both on, in such case you wouldn't have to do more than actually put the 'link' you mentioned before. Single sign on is a configuration matter rather than a coding thing unless your other application doesn't support it. I hope this helps you a little bit more.
This sounds alot easiser, however, again an example would help. My "other web app" is a vb.net app. From what I've read about single sign on in ASP.NET, it seems that both website applications would need the "same machine keys". These seems more specific to allowing single sign on between 2 .NET applications.
Could you provide a code example of how to get Single Sign On to work between the Lawson portal application (JSP) and a .NET application? Thanks.
Posted By PaulJ on 10/13/2009 08:51 AM Posted By vb on 10/09/2009 02:23 PM Sure it does, what you are looking for is called 'single sign on' which I know for a fact Lawson fully support, my suggestion to you is find out if the other web app you refer to is 'single sign on' capable and then turn both on, in such case you wouldn't have to do more than actually put the 'link' you mentioned before. Single sign on is a configuration matter rather than a coding thing unless your other application doesn't support it. I hope this helps you a little bit more. This sounds alot easiser, however, again an example would help. My "other web app" is a vb.net app. From what I've read about single sign on in ASP.NET, it seems that both website applications would need the "same machine keys". These seems more specific to allowing single sign on between 2 .NET applications. Could you provide a code example of how to get Single Sign On to work between the Lawson portal application (JSP) and a .NET application? Thanks.
This may give you some ideas:
http://publib.boulder.ibm...ng/iiyva_ldapd02.htm
http://www.codeproject.co.../dotnet/LDAPSSO.aspx
http://www.c-sharpcorner....mAuthentication.aspx
By the way, for the code I have shown which allows you to query data out of Lawson, I think makes sense to add this lines at the end of the code,It is the logout.
I'm using .NET as well. Can you post the code that worked?
Thanks!
You can find two dummy source code in the page number 2 of this topic, the second one is which I was able to use.