HighTechTalks DotNet Forums  

Getting a AD user name ...

ASP.net Security microsoft.public.dotnet.framework.aspnet.security


Discuss Getting a AD user name ... in the ASP.net Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
David Lozzi
 
Posts: n/a

Default Getting a AD user name ... - 12-03-2007 , 10:59 AM






Howdy,

I have an ASP.Net 2.0 web application for which all i need to do is grab the
user's login name. Currently, IIS is configured for anonymous access, which
i need to keep. I tried request.servervariables("LOGON_USER") and
REMOTE_USER, both return nothing. If I disable anonymouse security in IIS it
works and returns my login name.

I have also enabled forms authentication on my application, see below, and i
simply get page cannot be found, which is getting annoying. I don't need to
do anything with AD except get the user name, so using the full membership
class for AD is a little over kill. I am storing all of the user's
permissions for the app in the application using basic session strings. But
i'll do what it takes. Any ideas??

<connectionStrings>
<add name="ADConnectionString"
connectionString="LDAP://delphi.local/CN=Users,DC=delphi,DC=local" />
</connectionStrings>

<authentication mode="Forms">
<forms name=".ADAuthCookie" timeout="30" >
</forms>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<membership defaultProvider="MyADMembershipProvider">
<providers>
<add name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershi pProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADConnectionString" connectionUsername="delphi\dlozzi"
connectionPassword="12345"/>
</providers>
</membership>

Thanks!!

David Lozzi
Blog: http://www.lozzi.net


Reply With Quote
  #2  
Old   
Joe Kaplan
 
Posts: n/a

Default Re: Getting a AD user name ... - 12-03-2007 , 06:59 PM






Why not just enable Windows authentication in IIS? It is by far the easiest
way to go. What is the attraction with doing forms authentication?

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"David Lozzi" <dlozzi (AT) delphi-ts (DOT) com> wrote

Quote:
Howdy,

I have an ASP.Net 2.0 web application for which all i need to do is grab
the user's login name. Currently, IIS is configured for anonymous access,
which i need to keep. I tried request.servervariables("LOGON_USER") and
REMOTE_USER, both return nothing. If I disable anonymouse security in IIS
it works and returns my login name.

I have also enabled forms authentication on my application, see below, and
i simply get page cannot be found, which is getting annoying. I don't need
to do anything with AD except get the user name, so using the full
membership class for AD is a little over kill. I am storing all of the
user's permissions for the app in the application using basic session
strings. But i'll do what it takes. Any ideas??

connectionStrings
add name="ADConnectionString"
connectionString="LDAP://delphi.local/CN=Users,DC=delphi,DC=local" /
/connectionStrings

authentication mode="Forms"
forms name=".ADAuthCookie" timeout="30"
/forms
/authentication
authorization
deny users="?"/
allow users="*"/
/authorization
membership defaultProvider="MyADMembershipProvider"
providers
add name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershi pProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADConnectionString"
connectionUsername="delphi\dlozzi" connectionPassword="12345"/
/providers
/membership

Thanks!!

David Lozzi
Blog: http://www.lozzi.net



Reply With Quote
  #3  
Old   
David Lozzi
 
Posts: n/a

Default Re: Getting a AD user name ... - 12-11-2007 , 12:21 PM



I did. I don't know why I wanted forms auth... been a long freaken month

Thanks


"Joe Kaplan" <joseph.e.kaplan (AT) removethis (DOT) accenture.com> wrote

Quote:
Why not just enable Windows authentication in IIS? It is by far the
easiest way to go. What is the attraction with doing forms
authentication?

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services
Programming"
http://www.directoryprogramming.net
--
"David Lozzi" <dlozzi (AT) delphi-ts (DOT) com> wrote in message
news09E63E2-484F-4DEA-9AF7-19A5A63EFC47 (AT) microsoft (DOT) com...
Howdy,

I have an ASP.Net 2.0 web application for which all i need to do is grab
the user's login name. Currently, IIS is configured for anonymous access,
which i need to keep. I tried request.servervariables("LOGON_USER") and
REMOTE_USER, both return nothing. If I disable anonymouse security in IIS
it works and returns my login name.

I have also enabled forms authentication on my application, see below,
and i simply get page cannot be found, which is getting annoying. I don't
need to do anything with AD except get the user name, so using the full
membership class for AD is a little over kill. I am storing all of the
user's permissions for the app in the application using basic session
strings. But i'll do what it takes. Any ideas??

connectionStrings
add name="ADConnectionString"
connectionString="LDAP://delphi.local/CN=Users,DC=delphi,DC=local" /
/connectionStrings

authentication mode="Forms"
forms name=".ADAuthCookie" timeout="30"
/forms
/authentication
authorization
deny users="?"/
allow users="*"/
/authorization
membership defaultProvider="MyADMembershipProvider"
providers
add name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershi pProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADConnectionString"
connectionUsername="delphi\dlozzi" connectionPassword="12345"/
/providers
/membership

Thanks!!

David Lozzi
Blog: http://www.lozzi.net




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.