사용자 이름과 암호가 포함 된 웹 양식의 내용을 가져 와서 Kerberos를 사용하여 Windows 기반 도메인에 인증하는 Java 기반 웹 응용 프로그램이 있습니다.Kerberos에 대한 자세한 로깅 활성화
KDC 주소는 각 조회시 다른 IP 주소로 매핑되도록 구성되어 있으며 이는 명령 줄에서 ping 명령을 사용하여 확인할 수 있습니다.
전화가 대부분의 요청에 즉시 응답하지만 응답이 느리게 (5-10 초 또는 그 이상) 간헐적으로 발생합니다. 나는 이것이 어떤 도메인 컨트롤러가 사용 된 것일 수 있다고 생각한다.
kerberos 로깅을 설정하려고했지만 도메인 컨트롤러의 IP 주소가 표시되지 않습니다. dodgy 도메인 컨트롤러를 식별하기 위해 자세한 로깅을 어떻게 설정할 수 있습니까?
코드 추출은 파일 시스템에서 kerb.conf 및 kerb_context.conf를 가져옵니다.
kerb.conf은 다음과 같습니다
[libdefaults]
default_realm = EXAMPLE.COM
[realms]
CYMRU.NHS.UK = {
kdc = example.com:88
admin_server = example.com
kpasswd_server = example.com
}
kerb_context.conf은 다음과 같습니다
primaryLoginContext {
com.sun.security.auth.module.Krb5LoginModule required
useTicketCache=false
refreshKrb5Config=true
debug=true;
};
예제 소스입니다 : 내가 설정하는 방법을 찾을 수 없습니다
static NadexUser executePerformLogin(String username, String password) throws LoginException {
char[] passwd = password.toCharArray();
String kerbConf = ERXFileUtilities.pathForResourceNamed("nadex/kerb.conf", "RSCorp", null);
String kerbContextConf = ERXFileUtilities.pathURLForResourceNamed("nadex/kerb_context.conf", "RSCorp", null).toExternalForm();
System.setProperty("java.security.krb5.conf", kerbConf);
System.setProperty("java.security.auth.login.config", kerbContextConf);
try {
LoginContext lc = new LoginContext("primaryLoginContext", new UserNamePasswordCallbackHandler(username, password));
lc.login();
return new _NadexUser(lc.getSubject());
}
catch (javax.security.auth.login.LoginException le) {
throw new LoginException("Failed to login : " + le.getLocalizedMessage(), le);
}
}
Oracle documentation를 참조하십시오'-Dsun.security.krb5.debug = TRUE '내가 복사하고이 충분한 시간을 붙여, 그래서 내가 한 라이너 만들 것이라고 생각했다. –