I need to authenticate users against Active Directory using email address.
Currently I use username (sAMAccountName) to authenticate against AD and is using default membership provider "System.Web.Security.ActiveDirectoryMembershipProvider".
I have configured the authentication using samaccountname by adding the following line in Web.config.
As far as I understand the property 'attributeMapUsername' need to be mapped to 'sAMAccountName' or 'userPrincipalName'. I am not sure if authentication using email address can be done
using the deafult ActiveDirectoryMembershipProvider. Or do I need to write a custom membershipprovider to
achieve this ?
Member
1 Points
9 Posts
Authenticate against Active Directory using LDAP
Feb 01, 2011 07:18 PM|kdkv|LINK
I need to authenticate users against Active Directory using email address.
Currently I use username (sAMAccountName) to authenticate against AD and is using default membership provider "System.Web.Security.ActiveDirectoryMembershipProvider".
I have configured the authentication using samaccountname by adding the following line in Web.config.
<add name="MembershipADProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="XX" connectionStringName="ADConnectionString" connectionUsername="abc" connectionPassword="xyz" attributeMapUsername="sAMAccountName"/>
As far as I understand the property 'attributeMapUsername' need to be mapped to 'sAMAccountName' or 'userPrincipalName'. I am not sure if authentication using email address can be done using the deafult ActiveDirectoryMembershipProvider. Or do I need to write a custom membershipprovider to achieve this ?
Let me know if anyone has done something similar.
All-Star
35149 Points
9075 Posts
Re: Authenticate against Active Directory using LDAP
Feb 23, 2013 04:28 AM|smirnov|LINK
Did you try
attributeMapUsername = "mail" ?
Also if
attributeMapUsername="userPrincipalName"
then user names must have the format UserName@DomainName; for example, mary@testdomain.com or steve@testdomain.com.
http://msdn.microsoft.com/en-us/library/ff650307.aspx
Member
24 Points
33 Posts
Re: Authenticate against Active Directory using LDAP
Apr 03, 2014 06:24 AM|Nilzor|LINK
Same issue here. Did you ever find a solution? Had to write own provider?