인바운드 ID 맵핑 구성

인바운드 ID 맵핑을 위해 사용자 정의 로그인 모듈을 쓰고 시스템 로그인 구성 내에서 처음으로 로그인 모듈을 실행하기 위해 WebSphere® Application Server을 구성하십시오. 사용자 정의 로그인 모듈을 쓸 때 다음 단계를 고려하십시오.

프로시저

  1. 콜백으로부터 인바운드 사용자 ID를 얻고 필요한 경우 ID를 맵핑하십시오. 이 단계는 로그인 모듈의 로그인 메소드에서 발생합니다. 유효한 인증에는 NameCallback 및 WSCredTokenCallback 콜백 둘 모두가 있습니다. 다음 코드 샘플은 사용자 ID를 판별하는 방법을 보여줍니다.
    javax.security.auth.callback.Callback callbacks[] = 
       new javax.security.auth.callback.Callback[3];
    	callbacks[0] = new javax.security.auth.callback.NameCallback("");
    	callbacks[1] = new javax.security.auth.callback.PasswordCallback
         ("Password: ", false);
    	callbacks[2] = new com.ibm.websphere.security.auth.callback.
         WSCredTokenCallbackImpl("");
    	callbacks[3] = new com.ibm.wsspi.security.auth.callback.
         WSTokenHolderCallback("");
    
    	try 
    	{
    		callbackHandler.handle(callbacks);
    	} 
    	catch (Exception e)
    	{
    		// Handles exceptions
    		throw new WSLoginFailedException (e.getMessage(), e);
    	}
    
    	// Shows which callbacks contain information
    	boolean identitySwitched = false;
    	String uid = ((NameCallback) callbacks[0]).getName();
    	char password[] = ((PasswordCallback) callbacks[1]).getPassword();
    	byte[] credToken = ((WSCredTokenCallbackImpl) callbacks[2]).getCredToken();
    	java.util.List authzTokenList = ((WSTokenHolderCallback) 
         callbacks[3]).getTokenHolderList();
    
    	if (credToken != null)
    	{
    		try 
    		{
    			String uniqueID = WSSecurityPropagationHelper.validateLTPAToken(credToken);
    			String realm = WSSecurityPropagationHelper.getRealmFromUniqueID (uniqueID);
           // Now set the string to the UID so that you can use the result for either
           // mapping or logging in.
    			uid = WSSecurityPropagationHelper.getUserFromUniqueID (uniqueID);
    		}
    		catch (Exception e)
    		{
    			// Handles the exception
    		}	
    	}
    	else if (uid == null)
    	{
         // Throws an exception if authentication data is not valid.
         // You must have either UID or CredToken
    		throw new WSLoginFailedException("invalid authentication data.");
    	}
    	else if (uid != null && password != null)
    	{
         // This is a typical authentication. You can choose to map this ID to  
         // another ID or you can skip it and allow WebSphere Application Server 
         // to log in for you. When passwords are presented, be very careful to not 
         // validate the password because this is the initial authentication.
    		
    		return true;
    	}
    
        // If desired, map this uid to something else and set the identitySwitched 
        // boolean. If the identity was changed, clear the propagated attributes 
        // below so they are not used incorrectly.
    	uid = myCustomMappingRoutine (uid);
    	
        // Clear the propagated attributes because they are no longer applicable 
        // to the new identity
    	if (identitySwitched)
    	{
    		((WSTokenHolderCallback) callbacks[3]).setTokenHolderList(null);
    	}
  2. 속성 전파가 발생했는지 확인하고 사용자의 속성이 ID가 동일하게 남아 있을 때 이미 존재하는지를 확인하십시오. 사용자 레지스트리 검색에 중복 호출을 피하기 위해서는 전송 서버로부터 사용자 속성이 이미 존재하는지 여부를 확인하십시오. 사용자 속성을 확인하려면 콜백에 있는 정보를 분석하는 WSTokenHolderCallback 콜백에서 메소드를 사용하여 정보가 WebSphere Application Server이 제목을 작성하기에 충분한지 여부를 판별하십시오. 다음 코드 샘플은 사용자 속성을 확인합니다.
    boolean requiresLogin = 
    ((com.ibm.wsspi.security.auth.callback.WSTokenHolderCallback) 
    callbacks[2]).getrequiresLogin();
    권한 부여를 수행하는 데 필요한 WSCredential 및 WSPrincipal 오브젝트를 형성하기 위해 충분한 속성이 존재하지 않으면 이전 코드 샘플은 true 결과를 리턴합니다. 결과가 false이면 추가 원격 사용자 레지스트리 호출을 수행하지 않고 제목을 작성하기 위해 필요한 정보가 존재할 때 처리를 중지하기로 선택할 수 있습니다.
  3. 옵션: 사용자 레지스트리로부터 필요한 속성을 검색하고 속성을 hashtable에 놓고, hashtable을 공유 상태에 추가하십시오. ID가 이 로그인 모듈에서 교환되면 다음 단계를 완료해야 합니다.
    1. 다음 예제에 표시된 대로 속성의 hashtable을 작성하십시오.
    2. hashtable을 공유 상태에 추가하십시오.
    ID가 교환되지 않았지만 이전에 표시된 requiresLogin 코드 샘플의 값이 true이면 속성의 hashtable을 작성할 수 있습니다. 그러나 WebSphere Application Server이 로그인을 처리하는 동안 이 상황에서 hashtable을 작성할 필요가 없습니다. 그러나 사용자 자체 특수 사용자 레지스트리를 사용 중인 특별한 경우에는 속성을 수집하기 위해 hashtable을 작성하는 것을 고려할 수도 있습니다. hashtable을 사용하고 WebSphere Application Server이 사용자 속성을 수집하도록 하여 UserRegistry 구현을 작성하는 것이 가장 쉬운 해결책일 수도 있습니다. 다음 테이블은 사용자 속성의 hashtable을 작성하는 방법을 보여줍니다.
    if (requiresLogin || identitySwitched)
    	{
    		// Retrieves the default InitialContext for this server.
    		javax.naming.InitialContext ctx = new javax.naming.InitialContext();
    
    		// Retrieves the local UserRegistry implementation.
    		com.ibm.websphere.security.UserRegistry reg = (com.ibm.websphere.
            security.UserRegistry) 
    		ctx.lookup("UserRegistry");				
    
         // Retrieves the user registry uniqueID based on the uid specified
         // in the NameCallback.
    		String uniqueid = reg.getUniqueUserId(uid);
    	 	uid = WSSecurityPropagationHelper.getUserFromUniqueID (uniqueid);
    			
         // Retrieves the display name from the user registry based on the uniqueID.
    		String securityName = reg.getUserSecurityName(uid);
    	
         // Retrieves the groups associated with the uniqueID.
    		java.util.List groupList = reg.getUniqueGroupIds(uid);
    			
         // Creates the java.util.Hashtable with the information that you gathered 
         // from the UserRegistry implementation.
    		java.util.Hashtable hashtable = new java.util.Hashtable();
    		hashtable.put(com.ibm.wsspi.security.token.AttributeNameConstants.
           WSCREDENTIAL_UNIQUEID, uniqueid);
         hashtable.put(com.ibm.wsspi.security.token.AttributeNameConstants.
           WSCREDENTIAL_SECURITYNAME, securityName);
    		hashtable.put(com.ibm.wsspi.security.token.AttributeNameConstants.
           WSCREDENTIAL_GROUPS, groupList);
    
         // Adds a cache key that is used as part of the lookup mechanism for 
         // the created Subject. The cache key can be an object, but should have 
         // an implemented toString method. Make sure that the cacheKey contains 
         // enough information to scope it to the user and any additional attributes 
         // that you are using. If you do not specify this property the Subject is 
         // scoped to the returned WSCREDENTIAL_UNIQUEID, by default.
    		hashtable.put(com.ibm.wsspi.security.token.AttributeNameConstants.
            WSCREDENTIAL_CACHE_KEY, "myCustomAttribute" + uniqueid);
    		// Adds the hashtable to the sharedState of the Subject.
    		_sharedState.put(com.ibm.wsspi.security.token.AttributeNameConstants.
            WSCREDENTIAL_PROPERTIES_KEY, hashtable);
    	}
    다음 규칙은 hashtable 로그인이 수행되는 방법을 자세히 정의합니다. 제목(공용 또는 개인용 신임 정보 세트) 또는 공유 상태 HashMap에서 java.util.Hashtable 오브젝트를 사용해야 합니다. com.ibm.wsspi.security.token.AttributeNameConstants 클래스는 사용자 정보를 포함하는 키를 정의합니다. hashtable 오브젝트가 LTPA(Lightweight Third Party Authentication) 로그인 모듈 앞에 나열되는 사용자 정의 로그인 모듈을 사용하여 로그인 컨텍스트의 공유 상태에 놓이면 java.util.Hashtable 오브젝트의 값은 공유 상태 hashMap 내에서 다음 키를 사용하여 검색됩니다.
    특성
    com.ibm.wsspi.security.cred.propertiesObject
    특성에 대한 참조
    AttributeNameConstants.WSCREDENTIAL_PROPERTIES_KEY
    설명
    이 키는 로그인 컨텍스트의 공유 상태에서 필수 특성을 포함하는 Hashtable 오브젝트를 검색합니다.
    예측 결과
    java.util.Hashtable 오브젝트

    java.util.Hashtable 오브젝트가 제목 내부에서나 공유 상태 영역 내에서 발견되면 다음 특성이 해시 테이블에 존재하는지 확인하십시오.

    특성
    com.ibm.wsspi.security.cred.uniqueId
    특성에 대한 참조
    AttributeNameConstants.WSCREDENTIAL_UNIQUEID
    리턴
    java.util.String
    설명
    특성의 값은 사용자의 고유 표시여야 합니다. WebSphere Application Server 기본 구현의 경우 이 특성은 애플리케이션 권한 부여 테이블에 저장되는 정보를 나타냅니다. 정보는 배치되고 사용자 대 역할 맵핑이 수행된 후에 애플리케이션 배치 디스크립터에 위치합니다. 사용자 대 역할 맵핑이 WebSphere Application Server 사용자 레지스트리 구현에 대한 검색을 사용하여 수행되는 경우 예상 형식 예제를 참조하십시오.

    써드파티 권한 부여 제공자가 사용자 대 역할 맵핑을 대체하면 써드파티 권한 제공자는 형식을 정의합니다. 고유 ID 값의 WebSphere Application Server 기본 구현과의 호환성을 보장하려면 WebSphere Application Server public String getUniqueUserId(String userSecurityName) UserRegistry 메소드를 호출하십시오.

    예상 형식 예제
    표 1. 형식 예제.

    이 테이블은 인바운드 ID 맵핑을 구성할 때 몇몇 형식 예제를 제공합니다.

    영역 형식(uniqueUserId)
    LDAP(Lightweight Directory Access Protocol) ldaphost.austin.ibm.com:389/cn=user,o=ibm,c=us
    Windows MYWINHOST/S-1-5-21-963918322-163748893-4247568029-500
    UNIX MYUNIXHOST/32

    com.ibm.wsspi.security.cred.uniqueId 특성은 필수입니다.

    특성
    com.ibm.wsspi.security.cred.securityName
    특성에 대한 참조
    AttributeNameConstants. WSCREDENTIAL_ SECURITYNAME
    리턴
    java.util.String
    설명
    이 특성은 인증 사용자의 securityName을 검색합니다. 이 이름은 일반적으로 표시 이름 또는 약칭으로 불립니다. WebSphere Application Server은 getRemoteUser, getUserPrincipal 및 getCallerPrincipal API(Application Programming Interface)의 securityName 속성을 사용합니다. securityName 값의 WebSphere Application Server 기본 구현과의 호환성을 보장하려면 WebSphere Application Server 공개 문자열 getUserSecurityName(String uniqueUserId) UserRegistry 메소드를 호출하십시오.
    예상 형식 예제
    표 2. 형식 예제. 이 테이블은 예상 형식 예제를 제공합니다.
    영역 형식(uniqueUserId)
    LDAP 사용자(LDAP UID)
    Windows user (Windows username)
    UNIX user (UNIX username)

    com.ibm.wsspi.security.cred.securityName 특성은 필수입니다.

    특성
    com.ibm.wsspi.security.cred.groups
    특성에 대한 참조
    AttributeNameConstants. WSCREDENTIAL_GROUPS
    리턴
    java.util.ArrayList
    설명
    이 키는 사용자가 속한 그룹의 배열 목록을 검색합니다. 그룹은 realm_name/user_name 형식에 지정됩니다. 이러한 그룹의 형식은 그룹이 배치 디스크립터에서 그룹 대 역할 맵핑을 위한 WebSphere Application Server 권한 부여 엔진에 의해 사용될 때 중요합니다. 제공된 형식은 WebSphere Application Server 기본 구현이 예상하는 형식과 일치해야 합니다. 써드파티 권한 부여 제공자를 사용할 때 써드파티 제공자가 예상하는 형식을 사용해야 합니다. 고유한 그룹 ID 값에 대해 WebSphere Application Server 기본 구현과의 호환성을 보장하려면 WebSphere Application Server 공용 목록 getUniqueGroupIds(String uniqueUserId) UserRegistry 메소드를 호출하십시오.
    배열 목록에서 각 그룹의 예상 형식 예제
    표 3. 형식 예제. 이 테이블은 배열 목록에서 각 그룹의 예상 형식 예제를 제공합니다.
    영역 포맷
    LDAP ldap1.austin.ibm.com:389/cn=group1,o=ibm,c=us
    Windows MYWINREALM/S-1-5-32-544
    UNIX MY/S-1-5-32-544

    com.ibm.wsspi.security.cred.groups 특성은 필수가 아닙니다. 사용자는 연관된 그룹이 필요하지 않습니다.

    특성
    com.ibm.wsspi.security.cred.cacheKey
    특성에 대한 참조
    AttributeNameConstants. WSCREDENTIAL_CACHE_KEY
    리턴
    java.lang.Object
    설명
    이 키 특성은 사용자 특정 정보 및 고유성에 영향을 미칠 수도 있는 사용자 동적 속성을 포함하여 로그인의 고유한 특성을 나타내는 오브젝트를 지정할 수 있습니다. 예를 들어, 사용자가 위치 A에서 로그인하면 이는 액세스 제어에 영향을 미칠 수 있고, 캐시 키는 수신되는 제목이 현재 위치의 올바른 제목이 될 수 있도록 위치 A를 포함해야 합니다.

    이 com.ibm.wsspi.security.cred.cacheKey 특성은 필요하지 않습니다. 이 특성이 지정되지 않은 경우, 캐시 찾아보기는 WSCREDENTIAL_UNIQUEID에 지정된 값입니다. 이 정보가 java.util.Hashtable 오브젝트에서 발견되면 WebSphere Application Server은 적어도 LTPA에 대해 일반 로그인 프로세스를 통과하는 제목과 유사한 제목을 작성합니다. 새 제목에는 hashtable 오브젝트에서 발견된 정보가 가득 채워지는 WSCredential 오브젝트 및 WSPrincipal 오브젝트가 포함됩니다.

  4. 사용자 정의 로그인 모듈을 RMI_INBOUND, WEB_INBOUND 및 DEFAULT JAAS(Java™ Authentication and Authorization Service) 시스템 로그인 구성에 추가하십시오. WebSphere Application Server이 새 사용자 정의 로그인 모듈을 먼저 로드할 수 있도록 RMI_INBOUND 로그인 구성을 구성하십시오.
    1. 보안 > 글로벌 보안 > JAAS(Java Authentication and Authorization Service) > 시스템 로그인 > RMI_INBOUND를 클릭하십시오.
    2. 추가 특성 아래에서 JAAS 로그인 모듈 > 새로 작성을 클릭하여 로그인 모듈을 RMI_INBOUND 구성에 추가하십시오.
    3. RMI_INBOUND의 JAAS 로그인 모듈 패널로 돌아가십시오.
    4. 순서 설정을 클릭하고 WebSphere Application Server이 사용자 정의 로그인 모듈을 먼저 로드할 수 있도록 로그인 모듈이 로드되는 순서를 변경하십시오. 로그인 모듈의 순서를 정렬하려면 위로 이동 또는 아래로 이동 단추를 사용하십시오.
    5. WEB_INBOUND 및 DEFAULT 로그인 구성에 대해 앞의 세 단계를 반복하십시오.

결과

이 프로세스는 인바운드 요청을 위해 ID 맵핑을 구성합니다.

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



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