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) ~[?:?]
확인결과 인증하는 계정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
반응형
'개발 > Java' 카테고리의 다른 글
RandomStringUtils.randomAlphanumeric 3.17.0 버전에서의 deprecated (0) | 2024.12.30 |
---|---|
THEIA IDE 다운로드 및 설치방법(윈도우10) (0) | 2024.07.30 |
[Swing] 윈도우 탐색기 또는 커맨드(cmd.exe) 실행하는 방법 (0) | 2024.01.09 |
[maven] package 수행시 Fatal error compiling 에러발생 (1) | 2024.01.05 |
Apache POI를 이용한 워드파일(.docx) 생성방법 (0) | 2023.11.07 |