SSO and AGS

 11 Replies
 1 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
mccreaja
New Member Send Private Message
Posts: 0
New Member

I am attempting to run AGS calls from outside the Lawson "environment" in 9.0. In 8.x it was a simple HTTP authenticate and passing the data in the URL to /ags.exe. However, in 9.0 with the session based management, things are a little trickier using /sso/SSOServlet. I have read the post for the ".Net 9.0 AGS call", but we are not using .Net and I feel something got lost in translation. I have attempted to send an HTTP POST to /sso/SSOServlet with the documented fields and faked cookies. Yet, all it returns is the login page HTML. I am either missing some key field or some trigger to bypass all of Lawson's JavaScript functionality.

Obviously a remote HTTP request will not run JavaScript. So is there another way? Has someone done this and can identify the common pitfalls?

 

Thanks,

Jason

Jason Beard
Veteran Member Send Private Message
Posts: 124
Veteran Member
if it is just a single call you are trying to make you should be able to execute something similar to the following:
http://servername/sso/SSO...ES&_serviceName=SSOP

Thanks,
Jason Beard
617-548-5568
jabeard3@gmail.com
Jason Beard
617-548-5568
jabeard3@gmail.com
mccreaja
New Member Send Private Message
Posts: 0
New Member

I have tried this format. It will work if I paste it in the browser, but not programmatically (web service call). It is something to do with the JavaScript run in the browser that keeps it from working programmatically. If you disable JS in your browser and clear your cookies, try to run that link - it will not work.

There has to be a work around...?

John Henley
Send Private Message
Posts: 3351
I think the primary point form the ".Net 9.0 AGS call" posting is that it's two steps. You have to get the cookie, and then pass the cookie. What programming environment are you using? If it's Java, you can also use the Lawson classes.
Thanks for using the LawsonGuru.com forums!
John
mccreaja
New Member Send Private Message
Posts: 0
New Member

I have tried passing the cookies for JSessionID and C.LWSN then POSTing the rest. We are using ColdFusion, which "is" Java. I would like to keep the solution in ColdFusion as that is what it was in the past. However, at this point I just want it to work.

Where would I download the Java classes to run a test?

Jason Beard
Veteran Member Send Private Message
Posts: 124
Veteran Member

Jason,

attached is a sample java servlet that authenticates and then executes a call.  the call in this case is to a workunit form however the concepts should be the same.  Please let me know if you have any questions.

Attachments
Jason Beard
617-548-5568
jabeard3@gmail.com
mccreaja
New Member Send Private Message
Posts: 0
New Member

Thanks. I will take a look. However, there is an example in the Lawson API Docs that uses Java and a SSOP object or something. This is not a native Java class. I was curious where this come from?

Still pretty interesting that you CAN NOT just post the 4 fields to the page and achieve a sucessful login.

mccreaja
New Member Send Private Message
Posts: 0
New Member
Are there any other solutions out there, what about the one in the documentation?
Jason Beard
Veteran Member Send Private Message
Posts: 124
Veteran Member

This was a custom test servlet we wrote to work out the kinks with the new LSF9 architecture.  My current client has a custom Applicant Self Service product which creates work units for approval etc.

We tried using the example in the manual... but had issues.  So we wrote it as you see.  You can ignore the code about trying the call a few times etc.  We were having issues with AD as a result of the way the bind was initially done.  I just haven't bothered to take out the unncessary code.

 

good luck

Jason Beard

617-548-5568

jabeard3@gmail.com

Jason Beard
617-548-5568
jabeard3@gmail.com
mccreaja
New Member Send Private Message
Posts: 0
New Member
I reread the documentation and acquired the lhc.jar file from the server. With this, and dependencies on Apache-Commons HTTP, Logging, and Codec JARs, I was able to get the example code from the documentation to work. Of course, like any other example code it had several errors. But most were obvious. I wrote an additional wrapper in Java that leverages the native Lawson API within lhc.jar. This seems to be some "black magic" as far as Lawson is concerned as I wasn't able to find much support. If anyone needs help on this please post back, I'd be glad share the solution.

Thanks,
Jason
Deleted User
New Member Send Private Message
Posts: 0
New Member

Yes, please. post more info.  Ourselves also just got hit with such an 'opportunity to update code'.

Using web service calls to the AGS (exe or java) works just fine in the past with Apache.  Now, with websphere, we can not get much past the front door yet.  I am at the same stage as the earlier posts (basically, wrapping the url inside the login url).

mccreaja
New Member Send Private Message
Posts: 0
New Member

No problem. The attached file is a Java class that wraps the Lawson API. It is a mix of corrected code from the Lawson Documentation example with some added error checking. There are a few comments, but it should be straightforward enough. The trick is getting the it to run. You will need the lhc.jar file from your Lawson environment, and it has dependencies on 3 Apache-commons JARs - HttpClient, Logging, Codec - which you can web search and download. With those it should run. Of course this is Lawson after all, so post any questions back.

Thanks,
Jason

Attachments