Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scripting method to get logged-on user properties

Status
Not open for further replies.

NGF

Programmer
Nov 20, 2003
5
0
0
FR
Hi All,

I am trying to get the login of a user using the Livelink API and the cookie Livelink writes (LLCookie). But here is my problem:

I have stored an URL in livelink pointing to a page where I want to get the current user's login. It is fairly easy with a java applet using the LLCookie and the User LAPI. The thing is I don't want to retreive it through a java applet but with a scripting method.

I tried with JSP, but it runs on the server and the cookie I get on the client is not valid on the server while creating a new LLSession. The cookie is unique to the machine you get the cookie from.

So my question is: is there a way to get the current user login within a session using a scripting method?

Thanks a lot,
Nico
 
So all said and done what will this finally do?

Livelink burns the cookie on a client so that the user requests need not authenticate to the livelink server every time it makes a request to the server.It would be foolish to
use the cookie from another machine since that would completely undermine the security so intentionally cookies are encrypted,decrypted by livelink using a very complex algorithm
However the request and response headers should contain enough information of the logged in user but will be good only for that session.So are you trying to login to another system using the livelink credentials?

Everybody is ignorant, only on different subjects. - Will Rogers

appnair

 
Hi appnair and thank you for your answer.

I am not trying to login to another system. I am working on the session only and I am just trying to get the redeable user login through and asp page.

For example, if I call the following page:

Code:
[URL unfurl="true"]http://myserver/livelink/livelink.exe?func=ll.login&username=myuser&password=passwd&NextURL=/livelink/myscript.asp[/URL]

I want the page "myscript.asp" to get the user login of "myuser" and its group and processes it (prints it out for example).

I looked at the HTTP headers, and I didn't find the user name in them nor any information about the user.

The cookie would be the ideal solution if I could use a Java applet, but I actually can't and I am just searching for a scripting solution.

Does anybody have any idea?

Thanks,
Nico
 
Interesting.Take a look at llglogin.html of your livelink installation.It is just a basic html form submission with a hidden func=ll.login calling the request handler for webll module.You can modify the llglogin.html to submit to your
asp ,parse the response variables enroute do what you need to do and then submit it to livelink.However this does not
guarantee that it is a successful login.If after login is succesfull you would want again to take look at the
request handler .Easier run a search for ExecuteWithLogin script put a break point and login.You then can see that the
request header r is an assoc containing your username and password.From here on livelink is going to use a cookie method.If you can use the IsFeature method you can declare your own extraheaders for your application.I hope you know your way around builder.Just a thought see if you can tweak the nextURL feature in the page.I had put some things about the nextURL in this forum sometime back,probably you can tweak the nextURL to your page and see if the assoc still has the username etc in that.



For example I have put the contents of the assoc r on login

R<'CONTENT_LENGTH'='143','CONTENT_TYPE'='application/x- image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*','HTTP_ACCEPT_ENCODING'='gzip, deflate','HTTP_ACCEPT_LANGUAGE'='en-us','HTTP_CACHE_CONTROL'='no-cache','HTTP_CONNECTION'='Keep-Alive','HTTP_CONTENT_LENGTH'='143','HTTP_CONTENT_TYPE'='application/x-www-form-urlencoded','HTTP_HOST'='localhost','HTTP_REFERER'=' (compatible; MSIE 6.0; Windows NT 5.0)','LLENVIRON_ASSOC'=A<1,?,'CONTENT_LENGTH'='143','CONTENT_TYPE'='application/x- image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*','HTTP_ACCEPT_ENCODING'='gzip, deflate','HTTP_ACCEPT_LANGUAGE'='en-us','HTTP_CACHE_CONTROL'='no-cache','HTTP_CONNECTION'='Keep-Alive','HTTP_CONTENT_LENGTH'='143','HTTP_CONTENT_TYPE'='application/x-www-form-urlencoded','HTTP_HOST'='localhost','HTTP_REFERER'=' (compatible; MSIE 6.0; Windows NT 5.0)','PATH_TRANSLATED'='c:\\inetpub\\


Everybody is ignorant, only on different subjects. - Will Rogers

appnair
 
Appnair,

Thank you a LOT for your very useful help. I was able to do what I want modifying the llglogin.html page.

Nico
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top