BodiSnacha Posted September 30, 2005 Share Posted September 30, 2005 Folks, I am interested in passing an environment variable in a URL. The goal is to automatically log the user in based on who they are logged onto the workstation as without any prompts.The url will be http://helpdeskserver/caisd/pdmweb.exe?USERNAME=%username%The web site is developed on IIS with Frontpage. Frontpage doesn't interpret the %username% correctly and passes an argument error. Can anyone assist?J (flynnj@sddc.army.mil) Link to comment Share on other sites More sharing options...
liquidplasmaflow Posted October 1, 2005 Share Posted October 1, 2005 How about using a Java/VBScript on the page linking to that page, a script that finds the username and appends it to the link? Link to comment Share on other sites More sharing options...
HyperHacker Posted November 16, 2005 Share Posted November 16, 2005 You might be able to get away with having the page just ask for their name, perhaps with a password like most do. If not, I'd write a small program which opens the page. GetUserName() will tell you the name, and I think you can use ShellExecute() to open the URL. (I did it once, but I don't recall how and don't feel like checking right now. Pretty sure that was it though. It opens in the user's default browser too.)If you need to keep track of the name on multiple pages, store it in a cookie or database with an expiration date and have a 'log out' link to clear it. If no name is logged, tell the user to run the program again, and offer a link to it.There might also be some ActiveX solution, but now you're getting into nasty IE-only stuff. Link to comment Share on other sites More sharing options...
Rhelic Posted November 16, 2005 Share Posted November 16, 2005 (edited) JavaScript has no way to grab the local users username. But in an Intranet solution with an Active Directory server, you can get the username via ASP and ASP.Net programming, here are my notes on the subject=================================================Retrieving the web user's username in a Domain/Intranet for ASP.Net=================================================Manage IIS > right Click Web Sites > Properties > Directory Security >Edit Button (Auth & Access Control) > uncheck 'Enable anonymous access'and make sure 'Integrated Widows Auth' is check markedThen if you want the ASP.Net to run as the web user then add this toyour web.config<identity impersonate="true" />Now you can access the username by:HttpContext.Current.User.Identity.Name;using System.Security.Principal;System.Threading.Thread.CurrentPrincipal.Identity.Name;or in classic ASP:Request.ServerVariables("LOGON_USER")-----------------------If your app is not ASP or ASP.Net you're probably screwed but I haven't used PHP, Cold Fusion or Perl for years and perhaps there is a way now. Edited November 16, 2005 by Rhelic Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now