2
죄송합니다. JNDI의 멍청한 놈입니다. JNDI를 사용하여 간단한 인증을 사용하여 LDAPS에 연결하려고합니다.하지만 데이터를 가져온 후 연결 방법을 알 수 없습니다. 예를 들어 내 나무입니다JNDI를 사용하여 ldap에서 데이터를 가져올 수있는 방법
public static void main(String[] args) {
// Set up environment for creating initial context
Hashtable<String, String> env = new Hashtable<String, String>(11);
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldaps://myadress:636");
// Authenticate as S. User and password "mysecret"
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "my BASE DN");
env.put(Context.SECURITY_CREDENTIALS, "mypass");
try {
// Create initial context
DirContext ctx = new InitialDirContext(env);
// Close the context when we're done
ctx.close();
} catch (NamingException e) {
e.printStackTrace();
}
}
난 내 트리 및 일부 데이터,하지만 어떻게 얻을 원하는
DirContext ctx = new InitialDirContext(env);`
후 .. : :입니까?
-ou=people,dc=info,dc=uni,dc=com
---ou=students
-----uid=5tey37
내가 어떻게 할 수있는 uid에 대한 데이터를 얻으시겠습니까?
미안 해요에 대한 멍청한 놈이야, 미안 내 영어
큰! 덕분에 많은 특정 속성 수 있습니다! – FelasDroid
@FelasDroid 너는 천만에 – PopoFibo