CORBA(Common Object Request Broker Architecture) 프로그램 로그인을 JAAS(Java Authentication and Authorization Service)로 마이그레이션(CORBA 및 JAAS)

CORBA 기반 프로그램 로그인 API를 사용하여 프로그램 로그인을 수행하는 방법의 예로 이 주제를 사용하십시오.

시작하기 전에

[AIX Solaris HP-UX Linux Windows][IBM i]이 문서는 사장된 CORBA(Common Object Request Broker Architecture) 프로그램 로그인 API 및 JAAS에서 제공하는 대안을 설명합니다. WebSphere® 애플리케이션 서버는 프로그램 로그인 API(Application Programming Interface)로 JAAS(Java™ Authentication and Authorization Service)를 전체 지원합니다. JAAS 지원에 대한 자세한 정보는 Java Authentication and Authorization Service의 프로그램 로그인 구성Java Authentication and Authorization Service의 프로그램 로그인 개발의 내용을 참조하십시오.

[z/OS]CORBA(Common Object Request Broker Architecture) API(Application Programming Interface)는 WebSphere 애플리케이션 서버 for z/OS® 환경에서 지원되지 않습니다. 다른 WebSphere 애플리케이션 서버 제품에서 WebSphere 애플리케이션 서버 for z/OS로 포팅하는 애플리케이션이 있는 경우 버전 6.0.x에서는 보안 API를 사용할 수 없습니다. WebSphere 애플리케이션 서버 for z/OS 버전 8.0에서 이들 애플리케이션을 사용하려면 JAAS(Java Authentication and Authorization Service)로 마이그레이션해야 합니다.

다음 목록은 더 이상 사용되지 않는 CORBA 프로그램 로그인 API를 포함합니다.
  • [AIX Solaris HP-UX Linux Windows][z/OS]${user.install.root}/installedApps/sampleApp.ear/default_app.war/WEB-INF/classes/LoginHelper.java.
  • [AIX Solaris HP-UX Linux Windows][z/OS]${user.install.root}/installedApps/sampleApp.ear/default_app.war/WEB-INF/classes/ServerSideAuthenticator.java.
  • [IBM i]profile_root/installedApps/sampleApp.ear/default_app.war/WEB-INF/classes/ServerSideAuthenticator.java.
  • [AIX Solaris HP-UX Linux Windows][IBM i]org.omg.SecurityLevel2.Credentials. 이 API는 제품에 포함되지만, API를 사용하도록 권장되지 않습니다.

WebSphere 애플리케이션 서버에서 제공하는 API는 표준 JAAS API의 조합이며 표준 JAAS 인터페이스의 제품 구현입니다.

[z/OS]WebSphere 애플리케이션 서버 for z/OS에서 제공하는 지원 API는 표준 JAAS API의 조합이며 일부 부 확장자를 가진 표준 JAAS 인터페이스의 제품 구현입니다.

다음 정보는 요약된 내용입니다. http://www.ibm.com/developerworks/java/jdk/security/에 있는 플랫폼의 JAAS 문서를 참조하십시오.

  • 프로그램 로그인 API:
    • javax.security.auth.login.LoginContext
    • javax.security.auth.callback.CallbackHandler 인터페이스: WebSphere 애플리케이션 서버 제품은 javax.security.auth.callback.CallbackHandler 인터페이스의 다음 구현을 제공합니다.
      com.ibm.websphere.security.auth.callback.WSCallbackHandlerImpl
      애플리케이션이 기본 인증 데이터(사용자 ID, 비밀번호 및 보안 영역) 또는 토큰 데이터를 제품 로그인 모듈에 넣으면 비프롬프트 CallbackHandler 핸들러를 제공합니다. 이 API는 서버측 로그인에 권장됩니다.
      [AIX Solaris HP-UX Linux Windows][IBM i]com.ibm.websphere.security.auth.callback.WSGUICallbackHandlerImpl
      [AIX Solaris HP-UX Linux Windows][IBM i]기본 인증 데이터(사용자 ID, 비밀번호 및 보안 영역)를 모으기 위한 로그인 프롬프트 CallbackHandler 핸들러를 제공합니다. 이 API는 클라이언트측 로그인에 권장됩니다.

      서버측에서 사용되는 경우, 입력을 위해 서버가 차단됩니다.

      com.ibm.websphere.security.auth.callback.WSStdinCallbackHandlerImpl
      기본 인증 데이터(사용자 ID, 비밀번호 및 보안 영역)를 모으기 위한 stdin 로그인 프롬프트 CallbackHandler 핸들러를 제공합니다. 이 API는 클라이언트측 로그인에 권장됩니다.
      참고: 서버측에서 사용되는 경우, 입력을 위해 서버가 차단됩니다.
    • javax.security.auth.callback.Callback 인터페이스:
      javax.security.auth.callback.NameCallback
      사용자 이름을 LoginModule 인터페이스에 전달하기 위해 JAAS에서 제공합니다.
      javax.security.auth.callback.PasswordCallback
      비밀번호를 LoginModule 인터페이스에 전달하기 위해 JAAS에서 제공합니다.
      com.ibm.websphere.security.auth.callback.WSCredTokenCallbackImpl
      토큰 기반 로그인을 수행하기 위해 제품에서 제공합니다. 이 API를 사용하여 애플리케이션은 토큰 바이트 배열을 LoginModules 인터페이스로 전달할 수 있습니다.
    • javax.security.auth.spi.LoginModule 인터페이스

      WebSphere 애플리케이션 서버에서는 클라이언트측 및 서버측 로그인을 위해 LoginModules 구현을 제공합니다. 세부사항은 Java Authentication and Authorization Service의 프로그램 로그인 구성을 참조하십시오.

  • javax.security.Subject:
    [AIX Solaris HP-UX Linux Windows][IBM i]com.ibm.websphere.security.auth.WSSubject
    [AIX Solaris HP-UX Linux Windows][IBM i]javax.security.Subject에서 신임을 사용하여 원격 J2EE 자원을 호출하기 위해 제품에서 제공되는 확장자
    [z/OS]com.ibm.websphere.security.auth.WSSubject
    [z/OS]javax.security.Subject에서 신임을 사용하여 원격 J2EE 자원을 호출하기 위해 제품에서 제공되는 확장자

    애플리케이션은 WebSphere 애플리케이션 서버 로그인 모듈의 명시적 호출에 의해 생성된 주제를 사용하여 J2EE 자원 액세스에 필요한 WSSubject.doAs 메소드를 호출해야 합니다.

    com.ibm.websphere.security.cred.WSCredential
    WebSphere 애플리케이션 서버 LoginModules 인터페이스에서의 정상적인 JAAS 로그인 이후에 com.ibm.websphere.security.cred.WSCredential 신임이 작성되어 주제에 저장됩니다.
    com.ibm.websphere.security.auth.WSPrincipal
    작성되어 WebSphere 애플리케이션 서버 LoginModules 인터페이스로 인증되는 주제에 저장되는 인증된 프린시펄.

프로시저

  1. [AIX Solaris HP-UX Linux Windows][IBM i]CORBA 기반 프로그램 로그인 API를 사용하여 프로그램 로그인을 수행하는 방법의 예로 다음을 사용하십시오. CORBA 기반 프로그램 로그인 API는 JAAS 로그인으로 바뀌었습니다.
    참고: 다음 예제에서 사용된 LoginHelper API(Application Programming Interface)는 WebSphere Application Server 버전 9.0에서 더 이상 사용되지 않고 이후 릴리스에서는 제거됩니다. 다음 단계에 표시된 JAAS 프로그램 로그인 API를 사용하도록 권장합니다.
    public class TestClient {
    ...
    private void performLogin() {
    // Get the ID and password of the user.
    String userid = customGetUserid();
    String password = customGetPassword();
    
    // Create a new security context to hold authentication data.
    LoginHelper loginHelper = new LoginHelper();
    try { 
    // Provide the ID and password of the user for authentication.
    org.omg.SecurityLevel2.Credentials credentials = 
    loginHelper.login(userid, password);
    
    // Use the new credentials for all future invocations.
    loginHelper.setInvocationCredentials(credentials);
    // Retrieve the name of the user from the credentials
    // so we can tell the user that login succeeded.
    
    String username = loginHelper.getUserName(credentials);
    System.out.println("Security context set for user: "+username);
    } catch (org.omg.SecurityLevel2.LoginFailed e) {
    // Handle the LoginFailed exception.
    }
    }
    ...
    }
  2. 다음 예를 사용하여 CORBA 기반 프로그램 로그인 API를 JAAS 프로그램 로그인 API로 마이그레이션하십시오.

    다음 예제에서는 애플리케이션 코드가 필수 Java 2 보안 권한을 위해 부여되었다고 가정합니다. 자세한 정보는 Java Authentication and Authorization Service의 프로그램 로그인 구성, 애플리케이션 개발을 위해 자원 및 API(Java 2 보안) 보호http://www.ibm.com/developerworks/java/jdk/security/에 있는 JAAS 문서를 참조하십시오.

    public class TestClient {
    ...
    private void performLogin() {
    // Create a new JAAS LoginContext.
    javax.security.auth.login.LoginContext lc = null;
    
    try { 
    // Use GUI prompt to gather the BasicAuth data.
    lc = new javax.security.auth.login.LoginContext("WSLogin",
    new com.ibm.websphere.security.auth.callback.WSGUICallbackHandlerImpl());
    
    // create a LoginContext and specify a CallbackHandler implementation
    // CallbackHandler implementation determine how authentication data is collected
    // in this case, the authentication date is collected by  login prompt
    //   and pass to the authentication mechanism implemented by the LoginModule.
    } catch (javax.security.auth.login.LoginException e) {
    System.err.println("ERROR: failed to instantiate a LoginContext and the exception: " 
    + e.getMessage());
    e.printStackTrace();
    
    // may be javax.security.auth.AuthPermission "createLoginContext" is not granted
    //   to the application, or the JAAS Login Configuration is not defined.
    }
    
    if (lc != null)
    try { 
    lc.login();  // perform login
    javax.security.auth.Subject s = lc.getSubject();
    // get the authenticated subject
    
    // Invoke a J2EE resources using the authenticated subject
    com.ibm.websphere.security.auth.WSSubject.doAs(s,
    new java.security.PrivilegedAction() {
    public Object run() {
    try { 
    bankAccount.deposit(100.00);  // where bankAccount is an protected EJB
    } catch (Exception e) {
    System.out.println("ERROR: error while accessing EJB resource, exception: " 
    + e.getMessage());
    e.printStackTrace();
    }
    return null;
    }
    }
    );
    
    // Retrieve the name of the principal from the Subject
    // so we can tell the user that login succeeded,
    // should only be one WSPrincipal.
    java.util.Set ps = 
    s.getPrincipals(com.ibm.websphere.security.auth.WSPrincipal.class);
    java.util.Iterator it = ps.iterator();
    while (it.hasNext()) {
    com.ibm.websphere.security.auth.WSPrincipal p =
    (com.ibm.websphere.security.auth.WSPrincipal) it.next();
    System.out.println("Principal: " + p.getName());
    }
    } catch (javax.security.auth.login.LoginException e) {
    System.err.println("ERROR: login failed with exception: " + e.getMessage());
    e.printStackTrace();
    
    // login failed, might want to provide relogin logic
    }
    }
    ...
    }

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



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