|
rdouglass -> RE: NT authentication (10/7/2004 9:21:41)
|
Hi Alex and Welcome to Outfront. I never have to code for the username/password/domain prompt if (at the server) you turn on Integrated Windows Authentication and turn *off* anonymous access to whatever directory the page is stored in. If that's setup, when you browse to a page in that directory, the server will prompt for those credentials if you're not already logged into the domain. Then you can use the code above to do whatever you want, I tend to set a session variable and then use that on all pages I need it. For instance, the code above could be: <% DIM UserName MyVar=request.servervariables("logon_user") MyVar=MyVar & "" MyPos = InstrRev(MyVar, "\", -1, 1) UserName=Mid(MyVar,MyPos+1,Len(MyVar)) Session("myUserName")=UserName %> Then, as long as the session is valid, just use it on any asp page like this: <%=Session("myUserName")%> Does that help?
|
|
|
|