Is it possible to use mixed-mode authentication with LDAP if my machine is not on the same domain?

Stephen Herz asked on August 25, 2020 22:53

I am trying to configure mixed-mode authentication using an LDAP connection. However, the server that is hosting the website is NOT on the same domain that the LDAP connection string is connecting too.

I am using a username and password that is active on the other domain and can verify that I can reach the Active Directory box at the LDAP location (we have a VPN set up). However, when I try to authenticate a user, I get the following message: The specified domain or server could not be contacted.

Does anyone know if it is possible to authenticate against a different Active Directory domain then the one the server is running on? Or is it mandatory that the server be on the same domain?

Recent Answers


Brian McKeiver answered on August 27, 2020 15:20

Stephen, I believe if your code attempts to connect to both (or multiple) domains with multiple Connection Strings it would be possible, or if one of your Domain Controllers has been joined to the other Domain (or vice versa) you might be able to get away with only asking one for the authentication and it would check both (not 100% on this to be honest, it's been awhile...).

The error you have stated makes me think the code is having issues connecting to the LDAP endpoint (domain controller). Have you specified the fully qualified domain in the LDAP connection string? As in typcially you would see LDAP://Domain/DC=Domain but sometimes you need the whole thing LDAP://Domain.local/DC=Domain,DC=local.

If you use ADExplorer on your windows server that is hosting the IIS Site (assuming you are on premise) can you view both domains from that tool on that server ?

0 votesVote for this answer Mark as a Correct answer

Stephen Herz answered on August 27, 2020 16:34 (last edited on August 27, 2020 16:43)

Brian, I am not attempting to use both domains. The IIS server IS connected to a local domain, but I only want to authenticate users from the remote domain. My server is NOT connected to that domain, I only want to use it for user authentication.

In my connection string, I am using the entire LDAP string. LDAP://Domain.local/DC=Domain,DC=local and are using a domain admin password for the domain in the connection string.

I guess the real question is, is it possible to use an external domain solely for user authentication.

0 votesVote for this answer Mark as a Correct answer

Brian McKeiver answered on August 27, 2020 16:44

Ok, sorry I misinterpreted it.

I mean the simple answer is yes, it should be possible. The more complicated part is how. Without knowing all the variables it would be hard to point you to the exact solution.

Brian

0 votesVote for this answer Mark as a Correct answer

Stephen Herz answered on August 27, 2020 16:52

One question I had regarding the LDAP lookup. What port does it use? I've asked Kentico support, but they didn't seem to know. And I don't see anything concrete in the documentation. I assumed it uses 389 and can verify that I can reach that port from my server, but if it uses another, more secure port, I will need to open that on my firewall.

Any ideas?

0 votesVote for this answer Mark as a Correct answer

Brian McKeiver answered on August 27, 2020 16:58

Yeah I think it is default 389. You can force it to be sure I believe

"LDAP://" + LDAP_ServerAddress + ":389/"

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on September 1, 2020 16:44

Hi Stephen Can you check is port 636 is open if they are using secure ldap? link text

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on September 1, 2020 17:33

Also, port 445 did the trick for a lot of people based on link text

"Opening up port 445 did the trick for me. I could connect via System.DirectoryServices.DirectoryEntry(...) just fine using my LDAP connection string, but any attempts to connect via the ActiveDirectoryMembershipProvider would yield the following error: The specified domain or server could not be contacted. Opening up this port resolved the issue. "

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.