Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We are implementing Form based authentication using Ldap membership. We are trying to allow user to login with mail id as well as domain name.

Currently we are setting either mail or sAMAccountName in user attribute in web.config.

Could you please help to keep both mail as well as sAMAccountName together in web.config file?

What I have tried:

I tried using sAMAccountName in userNameAttribute in below code in web.config file of SharePoint application.It is working fine with domain name.

Then I tried using mail in userNameAttribute in below code in web.config file of SharePoint application.It is working fine with email address.

we want both to be worked in one go.

<add name="LdapMember" type="Microsoft.Office.Server.Security.LdapMembershipProvider, Microsoft.Office.Server, Version=16.0.0.0, Culture=neutral, PublicKeyToken=*******" server="*****" port="389" useSSL="false" userDNAttribute="distinguishedName" userNameAttribute="sAMAccountName" userContainer="DC=***,DC=*****" userObjectClass="person" userFilter="(ObjectClass=person)" scope="Subtree" otherRequiredUserAttributes="sn,givenname,cn" />
Posted
Updated 21-Apr-20 6:23am

1 solution

The LdapMembershipProvider wasn't written to support using multiple attributes for the username. You can't fix that by changing the config file; you'd have to write your own membership provider.

Unfortunately, the Microsoft.Office.Server assembly doesn't appear to be open source, so there's no way legally view the source of the existing provider, or to see whether it would be possible to extend that provider rather than reimplementing the whole thing.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900