Kerberos 클라이언트 프린시펄 이름을 SPNEGO TAI(더 이상 사용되지 않음)의 WebSphere 사용자 레지스트리 ID로 맵핑

시스템 프로그래밍 인터페이스를 사용하면 Microsoft Active Directory에서 검색되는 일반 사용자의 ID를 WebSphere® Application Server 보안 레지스트리에서 사용되는 ID로 일반 맵핑하여 SPNEGO(Simple and Protected GSS-API Negotiation Mechanism) 신뢰 연관 인터셉터(TAI)의 동작을 사용자 정의할 수 있습니다.

시작하기 전에

SPNEGO TAI를 사용하고 요청자의 ID가 WebSphere Application Server 사용자 레지스트리의 ID와 일치하는지 확인하기 위해서는 WebSphere Application Server 환경에서 일부 관리 태스크를 수행해야 합니다.
제거된 기능 제거된 기능:

WebSphere 애플리케이션 서버 버전 6.1에서는 SPNEGO(Simple and Protected GSS-API Negotiation Mechanism)를 사용하여 보안 설정된 자원에 대해 HTTP 요청을 안전하게 처리하고 인증하는 신뢰 연관 인터셉터(TAI)가 도입되었습니다. WebSphere Application Server 7.0에서 이 기능은 이제 더 이상 사용되지 않습니다. SPNEGO 웹 인증을 사용하면 SPNEGO 필터를 동적으로 다시 로드하고 애플리케이션 로그인 메소드로의 대체를 사용할 수 있습니다.

depfeat
참고: 다음 태스크가 성공적으로 수행되었는지 확인하십시오.
  1. SPNEGO를 사용하도록 웹 브라우저 구성. SPNEGO TAI(더 이상 사용되지 않음)를 사용하기 위해 클라이언트 브라우저 구성의 내용을 참조하십시오.
  2. JVM(Java™ Virtual Machine) 특성, 사용자 정의 SPNEGO TAI 특성 구성 및 SPNEGO TAI 사용 설정. WebSphere Application Server(더 이상 사용되지 않음)에서 JVM 사용자 정의 특성 구성, HTTP 요청 필터링 및 SPNEGO TAI 사용 설정의 내용을 참조하십시오.

이 태스크 정보

SPNEGO TAI의 가장 단순한 배치에서 WebSphere Application Server 사용자 레지스트리에서 요청자의 ID가 검색된 ID와 동일한 것으로 가정됩니다. 이는 Microsoft Windows Active Directory 서버가 WebSphere Application Server에서 사용되는 LDAP(Lightweight Directory Access Protocol) 서버인 경우입니다. 이는 SPNEGO TAI의 기본 동작입니다.

SPNEGO TAI의 이 단순 배치를 사용할 필요가 없습니다. WebSphere Application Server는 Microsoft Active Directory 대신에 로컬 OS, LDAP 또는 사용자 정의 레지스트리 등과 같은 다른 레지스트리를 사용할 수 있습니다. WebSphere Application Server가 Microsoft Active Directory와 다른 레지스트리를 사용하는 경우에는 Microsoft Windows 사용자 ID를 WebSphere Application Server 사용자 ID로의 맵핑은 필수입니다.

프로시저

JAAS 사용자 정의 로그인 모듈을 사용하여 클라이언트 Kerberos 프린시펄 이름을 Microsoft Active Directory에서 WebSphere 사용자 레지스트리 ID로 사용자 정의 맵핑을 수행하십시오. JAAS 사용자 정의 로그인 모듈은 WebSphere Application Server에서 수신 및 발신 요청을 인증하기 위해 정의되는 플러그인 메커니즘이고 ltpaLoginModule 전에 삽입됩니다. JAAS 사용자 정의 로그인 모듈은 subject.getPrincipals(KerberosPrincipal.class) 메소드를 사용하여 javax.security.auth.Subject에서 클라이언트 Kerberos 프린시펄 이름을 검색하고, 클라이언트 Kerberos 프린시펄 이름을 WebSphere 사용자 레지스트리 ID로 맵핑하고, 맵핑 ID를 해시 테이블 특성 com.ibm.wsspi.security.cred.userId에 삽입합니다. ltpaLoginModule은 그런 다음 맵핑된 ID를 사용하여 WSCredential을 작성합니다.
참고: 사용자 정의 로그인 모듈은 com.ibm.wsspi.security.tai.TAIResult에서 javax.security.auth.Subject의 보안 특성 전체 세트를 제공하여 맵핑된 ID를 완전히 확인할 수도 있습니다. ID가 완전히 확인되면, wsMapDefaultInboundLoginModule은 이러한 보안 특성을 WSCredential로 맵핑합니다.
사용자 정의 로그인 모듈의 샘플은 다음과 같습니다.
package com.ibm.ws.security.server.lm;

import java.util.Map;
import java.lang.reflect.Array;
import javax.security.auth.Subject;
import javax.security.auth.callback.*;
import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule;
import javax.security.auth.kerberos.*;
import com.ibm.websphere.security.auth.WSLoginFailedException;
import com.ibm.wsspi.security.token.AttributeNameConstants;

/**
 * 
 * @author IBM Corporation
 * @version 1.0
 * @since 1.0    
 *
 */

public class sampleSpnegoMappingLoginModule implements LoginModule {
    /*
     * 
     * Constant that represents the name of this mapping module.  Whenever this sample
     * code is used to create a class with a different name, this value should be changed.
     * 
     */
    private final static String MAPPING_MODULE_NAME = "com.ibm.websphere.security.sampleSpnegoMappingLoginModule";

    private String mapUid = null;
    /**
     * Construct an uninitialized WSLoginModuleImpl object.
     */
    public sampleSpnegoMappingLoginModule() {
        debugOut("sampleSpnegoMappingLoginModule() entry");
        debugOut("sampleSpnegoMappingLoginModule() exit");
    }

    /**
     * Initialize this login module.
     *
     * 
     * This is called by the  LoginContext after this login module is
     * instantiated. The relevant information is passed from the LoginContext
     * to this login module. If the login module does not understands any of the data
     * stored in the sharedState and options parameters,
     * they can be ignored.
     * 
     *
     * @param subject The subject to be authenticated.
     * @param callbackHandler
     *                A  CallbackHandler for communicating with the end user to gather 
                      login information (e.g., username and password).
     * @param sharedState
     *                The state shared with other configured login modules.
     * @param options The options specified in the login configuration for this particular login module.
     */
    public void initialize(Subject subject, CallbackHandler callbackHandler,
                           Map sharedState, Map options) {
        debugOut("initialize(subject = \"" + subject.toString() +
                 "\", callbackHandler = \"" + callbackHandler.toString() +
                 "\", sharedState = \"" + sharedState.toString() +
                 "\", options = \"" + options.toString() + "\")");

        this.subject = subject;
        this.callbackHandler = callbackHandler;
        this.sharedState = sharedState;
        this.options = options;

        debug = "true".equalsIgnoreCase((String)this.options.get("debug"));

        debugOut("initialize() exit");
    }

    /**
     * 
     * Method to authenticate a Subject (phase 1).
     * 
     *
     * 
     * This method authenticates a Subject. It uses CallbackHandler to gather
     * the Subject information, like username and password for example, and verify these
     * information. The result of the authentication is saved in the private state within
     * this login module.
     * 
     *
     * @return  true if the authentication succeeded, or false
     *         if this login module should be ignored.
     * @exception LoginException
     *                   If the authentication fails.
     */
    public boolean login() throws LoginException
    {
        debugOut("sampleSpnegoMappingLoginModule.login() entry"); 

        boolean succeeded = false;
        java.util.Set krb5Principals= subject.getPrincipals(KerberosPrincipal.class);
        java.util.Iterator krb5PrincIter = krb5Principals.iterator();

        while (krb5PrincIter.hasNext()) {
            Object princObj = krb5PrincIter.next();
            debugOut("Kerberos principal name: "+ princObj.toString());
            
            if (princObj != null && princObj.toString().equals("utle@WSSEC.AUSTIN.IBM.COM")){
                mapUid = "user1";
                debugOut("mapUid: "+mapUid);

                                 java.util.Hashtable customProperties = (java.util.Hashtable)
                                 sharedState.get(AttributeNameConstants.WSCREDENTIAL_PROPERTIES_KEY);
                                 if (customProperties == null) {
                                     customProperties = new java.util.Hashtable();
                                 }
                                 succeeded = true;
                                 customProperties.put(AttributeNameConstants.WSCREDENTIAL_USERID, mapUid);

                                 Map<String,java.util.Hashtable)>
                                 mySharedState=(Map<String,java.util.Hashtable>)sharedState;
                                 mySharedState.put((AttributeNameConstants.WSCREDENTIAL_PROPERTIES_KEY.customProperties);

                                 debugOut("Add a mapping user ID to Hashtable, mapping ID = "+mapUid); 

                                    }
                                 debugOut("login() custom properties = " + customProperties);
            }
        }

        succeeded = true;
        debugOut("sampleSpnegoMappingLoginModule.login() exit"); 

        return succeeded;
    }

    /**
     * 
     * Method to commit the authentication result (phase 2).
     * 
     *
     * 
     * This method is called if the LoginContext's overall authentication
     * succeeded (the revelant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL login module
     * succeeded).
     * 
     *
     * @return true if the commit succeeded, or false
     *         if this login module should be ignored.
     * @exception LoginException
     *                   If the commit fails.
     */
    public boolean commit() throws LoginException              
    {
        debugOut("commit()");

        debugOut("commit()");

        return true;
    }

    /**
     * Method to abort the authentication process (phase 2).
     *
     * 
     * This method is called if the LoginContext's overall authentication
     * failed (the revelant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL login module
     * did not succeed).
     * 
     *
     * 
     * If this login module's authentication attempt succeeded, then this method cleans
     * up the previous state saved in phase 1.
     * 
     *
     * @return true if the abort succeeded, or false
     *         if this login module should be ignored.
     * @exception LoginException
     *                   If the abort fails.
     */
    public boolean abort() throws LoginException {
        debugOut("abort() entry");
        debugOut("abort() exit");
        return true;
    }

    /**
     * Method which logs out a Subject.
     *
     * @return true if the logout succeeded, or false
     *         if this login module should be ignored.
     * @exception LoginException
     *                   If the logout fails.
     */
    public boolean logout() throws LoginException
    {
        debugOut("logout() entry");
        debugOut("logout() exit");

        return true;
    }

    private void cleanup()
    {
        debugOut("cleanup() entry");
        debugOut("cleanup() exit");
    }

    /*
     * 
     * Private method to print trace information.  This implementation uses System.out
     * to print trace information to standard output, but a custom tracing system can
     * be implemented here as well.
     * 
     */
    private void debugOut(Object o)
    {
        System.out.println("Debug: " + MAPPING_MODULE_NAME);
        if (o != null) {
            if (o.getClass().isArray()) {
                int length = Array.getLength(o);
                for (int i = 0; i < length; i++) {
                    System.out.println("\t" + Array.get(o, i));
                }
                    } else {
                System.out.println("\t" + o);
            }
        }
    }
    private Subject subject;
    private CallbackHandler callbackHandler;
    private Map sharedState;
    private Map options;

    protected boolean debug = false;
}

결과

사용자 정의 로그인 모듈을 사용하면, Microsoft Active Directory ID는 WebSphere Application Server의 보안 레지스트리로 맵핑되고 SPNEGO TAI의 동작이 사용자 정의됩니다.

주제 유형을 표시하는 아이콘 태스크 주제



시간소인 아이콘 마지막 업데이트 날짜: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tsec_SPNEGO_tai_umapper
파일 이름:tsec_SPNEGO_tai_umapper.html