|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to get network user name with FORMS authenticationI'm using FROMS authentication and want to automate the login.
Right now I force the user to manually log in. I would like to detect the users network userName and if they have an account I will automatically log them in. If they don't they wil be taken to the login page. I can get the network id of the user using System.Environment.UserName if I turn off anonymous access but this gived me an access denied error. If I turn on anonymous access I can get the the page but the userName I get is the IUsr account. How can I get the network user id? Don Turn off anonymous access, use Integrated Windows Authenication, and use the
PageUser.Identity.Name to get the login name. "Don" <chambers***@hotmail.com> ???????:1118437507.010448.115***@g43g2000cwa.googlegroups.com...Show quoteHide quote > I'm using FROMS authentication and want to automate the login. > > Right now I force the user to manually log in. I would like to detect > the users network userName and if they have an account I will > automatically log them in. If they don't they wil be taken to the > login page. > > I can get the network id of the user using System.Environment.UserName > if I turn off anonymous access but this gived me an access denied > error. If I turn on anonymous access I can get the the page but the > userName I get is the IUsr account. > > How can I get the network user id? > > Don > When I try this I get an exception when I try to redirect to another
page. The exception message is 'Thread was being aborted". I turned off allow anonymous access and set authentication mode='Windows". This is what I'm trying to accomplish:
I have an application called MasterSite that is used to authenticate users for all of our applications. Since we may have users that are not on our Domain each application needs to use FORMS authentication and the login URL is a page in this MasterSite application. This login page validates the suer against a table in the database. This works fine, the users are redirected to the login page in the MasterSite application, the FormsAuthentication Cookie is added to the response, and the response if redirected to the calling application. I then wanted to add the abiliy for our Domain users to seemlessly login. I added a column to the user table that holds a users network login name. I can then look up a user in page_load and if that network login name existis I can log them in as that user and redirect back to the calling application. If the network name does nto exist I continue process the page and they get the login prompt. Users on our domain who be automatically logged it but user not on the Domain could still manually login.
Other interesting topics
Code-Behind Pain in the Behind!
Best way to disable a site? Is there server control that you load with HTML from a URL Two DropDownLists getting crossed Getting more detailed errors Server.MapPath from a vb class validating Trying to wire up dropdownlist in datagrid Debugging Problems How to hide aspx from URL in address bar |
|||||||||||||||||||||||