How to get network user name with FORMS authentication

D

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
 
L

Lau Lei Cheong

Turn off anonymous access, use Integrated Windows Authenication, and use the
PageUser.Identity.Name to get the login name.
 
D

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".
 
D

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.
 

hp2

Joined
Jul 24, 2007
Messages
1
Reaction score
0
got it working?

Did you get it working? If so, how. I want to do something similair; both anonoymous and network automatically flow in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top