Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to get network user name with FORMS authentication

Reply
Thread Tools

How to get network user name with FORMS authentication

 
 
Don
Guest
Posts: n/a
 
      06-10-2005
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

 
Reply With Quote
 
 
 
 
Lau Lei Cheong
Guest
Posts: n/a
 
      06-13-2005
Turn off anonymous access, use Integrated Windows Authenication, and use the
PageUser.Identity.Name to get the login name.

"Don" <(E-Mail Removed)>
???????:(E-Mail Removed) egroups.com...
> 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
>



 
Reply With Quote
 
 
 
 
Don
Guest
Posts: n/a
 
      06-13-2005
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".

 
Reply With Quote
 
Don
Guest
Posts: n/a
 
      06-13-2005
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.

 
Reply With Quote
 
hp2 hp2 is offline
Junior Member
Join Date: Jul 2007
Posts: 1
 
      07-24-2007
Did you get it working? If so, how. I want to do something similair; both anonoymous and network automatically flow in.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
httpcontext.current.user.identity.name - Forms Authentication Doogie ASP .Net 1 02-08-2010 07:46 PM
Best practices for using forms authentication and security in a hosted env (was: Re: Using a Forms authentication in a shared hosting environment) JEFF ASP .Net 1 11-12-2007 07:00 PM
Forms Authentication User Name ashish ASP .Net 2 08-15-2006 09:04 PM
forms authentication -- expired forms cookie vs. not provided forms cookie Eric ASP .Net Security 2 01-27-2006 10:09 PM
Forms Authentication question: How to have some pages open and some requiring forms authentication Eric ASP .Net 2 02-13-2004 02:14 PM



Advertisments