views:

43

answers:

2

We are trying to set up the ActiveDirectoryMemebershipProvider for an ASP.NET intranet application that is supposed to automatically sign the users into the application when it is accessed in the browser.

However the browser is sending the FQDN (MYDOMAIN\some.user) to the server and the ActiveDirectoryMemebershipProvider seems not to be able to be able to find the user based on the FQDN. However when we test the provider manually from code we found that if we try just the user name (some.user) the provider seems to be able to find the user.

Is there any setting or anything we can use to make the provider skip the domain part sent from the browser ?

Cheers!

A: 

Try setting atttributeMapUsername if you haven't and let me know if that works for you. When I didn't set this I had to specify my users in [email protected] format.

My Web.config

    <add name="MyADMembershipProvider"
         type="System.Web.Security.ActiveDirectoryMembershipProvider" connectionStringName="ADConnectionString"
         attributeMapUsername="sAMAccountName"
         enablePasswordReset="false" maxInvalidPasswordAttempts="1" passwordAttemptWindow="15" 
         passwordAnswerAttemptLockoutDuration="1" minRequiredNonalphanumericCharacters="0" attributeMapEmail="mail"
         />
ryan
Hi there and thanks for the reply. We're trying to use automatic log on, the browser sends the username to the server. As far as we have gathered IE will send the username in the format MYDOMAIN\my.username. This does not seem to be accepted by the ActiveDirectoryMembershipProvider. At least it does not find any users that way. I tried the attributeMapUsername sett to sAMAccountName but it did not seem to help much
flalar
Can I see your code? Are you using IIS's settings for the authentication? You can select windows users authentication and disable anonymous users which is what we do here sometimes. With that you can pull the users login from the CGI variables, format it as needed, and run it through your authentication routine.
ryan
A: 

In IIS, go to the properties of the website and set the default domain to "\". Not sure which version of IIS you are using so if IIS resets this on you, the other way to accomplish this is to simply prepend the domain part so that it is added automatically?

Is this a custom app you are using or a product? Trying to understand why it is working from code but not from app. If you wrote the app, I assume you can change it to mimic your code. If you did not write the app, what is it? The app (such as OWA or SharePoint) may have a custom way it wants this done.

nelsonwebs