locked
Active Directory Membership Provider - Logon failure: unknown user name or bad password RRS feed

  • Question

  • User627985511 posted

    Hi,

    We are working on a asp.net 2.0 website where we are using active directory membership provider for active directory authentication.

    We have two providers in the providers section each using a different connection string for different domains.

    <configuration>
    <connectionStrings>
    <add name="Domain1" connectionString="<<Path1>>"/>
    <add name="Domain2" connectionString="<<Path2>>"/>
    </connectionStrings>
    <system.web>
    <compilation debug="true" strict="false" explicit="true"/>
    <membership defaultProvider ="Domain1_MembershipProvider">
    <providers>
    <add name="Domain1_MembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="Domain1" connectionUsername="xxxx" connectionPassword="xxxx" attributeMapUsername="sAMAccountName" />
    <add name="Domain2_MembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="Domain2" connectionUsername="xxxx" connectionPassword="xxxx" attributeMapUsername="SAMAccountName" />
    </providers>
    </membership>
    </system.web>
    </configuration>

    When we are trying to create an object for ActiveDirectoryMembershipProvider as below we are getting an error as "Logon failure: unknown user name or bad password"

    Dim domainProvider As ActiveDirectoryMembershipProvider = Nothing
    domainProvider = TryCast(Membership.Providers("Domain1"), ActiveDirectoryMembershipProvider)

    But if we comment out the second provider in the providers section everything works fine. Can you please let us know how can we resolve this issue.

    Thanks & Regards,

    Venkat

    Tuesday, July 1, 2014 12:00 PM

Answers

All replies