JAAS의 스레드로부터 호출자 제목 얻기
호출자 제목(또는 "수신된 제목")은 이 요청의 호출에 사용되는 사용자 인증 정보를 포함합니다. 이 제목은 기존 오브젝트를 대체하는 것을 방지하기 위해 WSSubject.getCallerSubject API(Application Programming Interface)를 실행한 후에 리턴됩니다. 제목은 읽기 전용으로 표시됩니다. 이 API는 신임 정보 내에 해시맵에 데이터를 놓거나 설정할 수 있도록 WSCredential 신임 정보에 액세스하는 데 사용할 수 있습니다.
시작하기 전에
이 API를 실행하려면 다음 Java™ 2 보안 권한이 필요합니다. permission javax.security.auth.AuthPermission "wssecurity.getCallerSubject";.
Kerberos 인증 메커니즘을 사용하는 경우 KDC 정책은 Kerberos 위임을 사용 가능으로 설정하고, 클라이언트에 전달 가능한 Kerberos 티켓이 있고, 제목에 Kerberos 티켓 및 GSS 위임 신임 정보가 있습니다. API를 사용하여 Kerberos 티켓 및 GSS 위임 신임 정보에 액세스할 수 있습니다.
이 태스크 정보
제목 내의 대부분의 데이터는 다른 서버로 다운스트림 전파되지 않습니다. WSCredential 신임 정보 내의 신임 정보 토큰만이 다운스트림 전파되고 새 호출자 제목이 생성됩니다.
프로시저
예
try { javax.security.auth.Subject caller_subject; com.ibm.websphere.security.cred.WSCredential caller_cred;
caller_subject = com.ibm.websphere.security.auth.WSSubject.getCallerSubject();
if (caller_subject != null) { caller_cred = caller_subject.getPublicCredentials
(com.ibm.websphere.security.cred.WSCredential.class).iterator().next();
String CALLERDATA = (String) caller_cred.get ("MYKEY");
System.out.println("My data from the Caller credential is: " + CALLERDATA); } }
catch (WSSecurityException e) { // log error } catch (Exception e) { // log error }