locked
AD Authentication on Internet application RRS feed

  • Question

  • User-1846245394 posted

     Hi Folks,

     

    I have been trying to get this working, I feel I am almost there

    here are the list of steps that I carried out  (incidently the domain server is currently remote to my development environment)

    1. opend up ports 389,636,445 on development server
    2. tested the following connection string via ADSI EDIT
      <add name="ADServer" connectionString="LDAP://255.255.255.1/ DC=domain, DC=com"/>  (IP address of server has been changed for this example)
    3. added the following provider 
      <providers >
      <
      add name="MyADMembershipProvider"  Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
      type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, " 
      applicationName="TestActiveDirectory" connectionStringName="ADServer" 
      connectionUsername="domain\admin" connectionPassword="addminpass" 
      attributeMapUsername="sAMAccountName"/>
      </
      providers>

    Now for the interesting stuff, when I set the values of connectionUsername & connectionPassword to an invalid user/password. I get the following error 
     Unable to establish secure connection with the server  when I attempt to retrieve the domain provider  as follows 

    Dim  domainProvider As MembershipProvider
    domainProvider = Membership.Providers("MyADMembershipProvider")

    If I set the values of connectionUsername & connectionPassword to a  valid user/password. I get the following error 
     The specified domain or server could not be contacted. when I attempt to retrieve the domain provider  as follows 

    Dim domainProvider As MembershipProvider
    domainProvider = Membership.Providers("MyADMembershipProvider")

     I would be grateful if someone could point me in the right direction here

     

    thanks

    Mark

    Wednesday, September 9, 2009 8:55 PM

All replies

  • User-738352979 posted
    in ur ldap connection string
    just write
     ldap://255.255.255.1  ( IP address only no need for  DC attribute)
    
     type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web,  Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
    make ur type like this 
    
    
    
    add one more attribute  test with "None"  and "Secure" 
    connectionProtection="None"
    
    
    hope this work


     

    Thursday, September 10, 2009 2:11 AM
  • User-1846245394 posted

     HI Somnath,

     

    thanks for your information,

    I had the type set as you said , there was a problem pasting it into this forum

    secondly I tried both your suggestions and still got the same results.

    It appears as though it is talking to the domain server as I am getting different results with  valid & invalid usernames/passwords

     

    Thanks Again

    Mark

     

     

    Thursday, September 10, 2009 2:54 AM
  • User-738352979 posted

      this may be because ur develoment server could not access the active direc try server 1. from ur development machine go start->run-> type the ip of active directry server check whether it is browsable or not. 2. Compuert browser service is running on active directry server through services.msc

    Thursday, September 10, 2009 3:47 AM
  • User-1846245394 posted

     Hi SomNath,

     

    yeah the  Computer browser service is running.

    the  Domain server is not browsable by symply typing in the IP address , however the domain server has got exchangeserver on it and I can access my emails via OWA using my active directory credentials,

     

    do you believe if  I publish the website to IIS and try it there, I'll get a better result ?

     

    Thanks

    Mark

     

     

    Thursday, September 10, 2009 9:34 PM