Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to translate a domain name to LDAP DC when working in a Active Directory forest in Java?
    primarykey
    data
    text
    <p>I am struggling with a problem where I wasn't able to find a lean and generic solution. This is my situation:</p> <p>I am in a huge AD forest with > 20 sub domains replicating over several hundreds servers. Say the main domain and Kerberos realm is <code>COMPANY.COM</code> and I am working in <code>D1.COMPANY.COM</code>. I do connect from Java to the global catalog and are able to access the entire forrest to support all company users.</p> <p>My connection URL is like this: <code>ldap://mycompany.com:3268/DC=company,DC=com</code></p> <p>The entire stuff is running in a webapp using SPNEGO to authenticate the users which works very well. I.e., after sucessful login I do receive the users UPN/Kerberos principal. Due to some reasons all UPN fields in the forest where altered to match user's email address rather to leave the UPN value intact. This means that I an not able to search for the search by the krb princ but I have to strip out the username and search by <code>sAMAccountName</code>. I presumed the <code>sAMAccountName</code> is unique in the entire forest until a user failed to login yesterday. After some LDAP query magic I figured out that two users have the same <code>sAMAccountName</code> in two different domains. My search fails.</p> <p>So the issue is, how do I determine the base DN/DC of a realm/sub domain based in the Kerberos realm?</p> <p>I figured out several approaches with a stripped realm string:</p> <ol> <li>constuct an LDAP URL and connect to and read defaultNamingContext</li> <li>reformat domain name to DC=d1,DC...</li> </ol> <p>Currently, I am using approach 2 which seems to be the easiest way. Altough some C# post here on stack overflow said that this might fail due to disjoint spaces.</p> <p>Is anyone aware of a safe solution? The best would be actually to translate Kerberos principals to user principal names.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload