본문 바로가기

개발/Java

LDAP 계정정보 조회에러(DSID-0C09050F)

728x90
반응형

 

LDAP으로 특정 계정정보가 존재하는지 체크하는 코드 개발 중 에러발생

[2024-07-29 09:21:19.168] [ERROR] [nio-8080-exec-4] AdServiceImpl.isAccountAuth:201 - ERROR

javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C09050F, comment: AcceptSecurityContext error, data 52e, v4563^@]
        at java.naming/com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3260) ~[?:?]
        at java.naming/com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3206) ~[?:?]
        at java.naming/com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2992) ~[?:?]
        at java.naming/com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2906) ~[?:?]
        at java.naming/com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:348) ~[?:?]
        at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxFromUrl(LdapCtxFactory.java:229) ~[?:?]
        at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:189) ~[?:?]
        at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:247) ~[?:?]
        at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154) ~[?:?]
        at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84) ~[?:?]
        at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:732) ~[?:?]
        at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305) ~[?:?]
        at java.naming/javax.naming.InitialContext.init(InitialContext.java:236) ~[?:?]
        at java.naming/javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:154) ~[?:?]

 

[LDAP] DSID-0C09050F

 

확인결과 인증하는 계정ID에 도메인을 지정해주어야 정상적으로 작동된다.

Hashtable<String, String> ldapEnv = new Hashtable<String, String>();
ldapEnv.put(Context.INITIAL_CONTEXT_FACTORY, AD_CONTEXT_FACTORY_NAME);
ldapEnv.put(Context.PROVIDER_URL, AD_URL);
ldapEnv.put(Context.SECURITY_AUTHENTICATION, AD_AUTHENTICATION);
ldapEnv.put(Context.SECURITY_PRINCIPAL, id + "@domain.co.kr");   // 이 부분 확인
ldapEnv.put(Context.SECURITY_CREDENTIALS, password);
ldapContext = new InitialLdapContext(ldapEnv, null);

 

728x90
반응형