Home All Groups Group Topic Archive Search About

How to get network user name with FORMS authentication

Author
10 Jun 2005 9:05 PM
Don
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

Author
13 Jun 2005 6:23 AM
Lau Lei Cheong
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
>
Are all your drivers up to date? click for free checkup

Author
13 Jun 2005 1:28 PM
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".
Author
13 Jun 2005 1:57 PM
Don
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.

Bookmark and Share