c# - Cannot connect to AD server through userprincipalname -
i'm trying connect ad server attributemapusername="userprincipalname"
, error
the server not operational
same code attributemapusername="samaccountname"
works fine.
sample web.config
<connectionstrings> <add name="myadproviderconnection" connectionstring="ldap://xxxx.xxxx.xxxx.com:636/ou=testou,dc=xxx,dc=xxxx,dc=xxxx" /> </connectionstrings> <membership defaultprovider="myadprovider" userisonlinetimewindow="15"> <providers> <add name="myadprovider" type="system.web.security.activedirectorymembershipprovider, system.web, version=2.0.3600.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a" connectionstringname="myadproviderconnection" connectionusername="administrator@xxxx.xxxx.com" connectionpassword="xxxxxx" connectionprotection="secure" clientsearchtimeout="120" serversearchtimeout="120" enablepasswordreset="false" enablesearchmethods="true" requiresquestionandanswer="false" applicationname="/" requiresuniqueemail="false" attributemappasswordquestion="department" attributemappasswordanswer="division" attributemapusername="userprincipalname" description="useless description." attributemapfailedpasswordanswercount="singleinteger" attributemapfailedpasswordanswertime="singlelargeinteger" attributemapfailedpasswordanswerlockouttime="dupsinglelargeinteger" minrequiredpasswordlength="1" minrequirednonalphanumericcharacters="0" /> </providers> </membership>
page code
membershipuser u = null; u = membership.createuser(@"testusera1", "pwd", "testusera1");
wiki
Comments
Post a Comment