JAAS ログイン・モジュール間における SAML トークンの引き渡し

SAMLGenerateLoginModule を使用して、アプリケーションの JAAS ログイン・モジュールで初期化された共有状態オブジェクトから、 アプリケーション生成の SAML トークンを入手することができます。 また、GenericIssuedTokenGenerateLoginModule を使用して、共有状態からアプリケーション生成の SAML トークンを入手することもできます。詳しくは、『スタックされた JAAS ログイン・モジュールを使用した SAML トークンの生成および消費』トピックを参照してください。

このタスクについて

次の手順では、この機能を使用するために必要なセットアップについて説明します。

手順

  1. JAAS ログイン・モジュールの initialize メソッドで、共有状態オブジェクトをクラス変数に保存します。
    import com.ibm.websphere.wssecurity.wssapi.token.SecurityToken;
    import com.ibm.websphere.wssecurity.wssapi.token.SAMLToken;
    import com.ibm.wsspi.wssecurity.core.Constants;
    
    public class myLoginModule implements LoginModule {
    ...
      private Map _sharedState;
    ...
    public void initialize(Subject subject, 
           CallbackHandle rcallbackHandler,
           Map<String, ?> sharedState,
           Map<String, ?> options) {
    ...
       this._sharedState = sharedState;
    ...
      }     
  2. 以下のいずれかの方法を使用して、アプリケーション生成の SAML トークンを sharedState オブジェクトに書き込みます。
      • SecurityToken の ArrayList を作成し、このリストに唯一のエントリーとしてアプリケーション生成の SAMLToken を書き込みます。WS-Security ランタイムは、このリスト内をループして、最初にヒットするもののみを使用します。
      • キー com.ibm.wsspi.wssecurity.core.Constants.WSSECURITY_TOKEN_TO_BE_INSERTED を使用して、ArrayList オブジェクトを _sharedState オブジェクトに書き込みます。
        com.ibm.wsspi.wssecurity.core.Constants.
        WSSECURITY_TOKEN_TO_BE_INSERTED
        
          public boolean login() throws LoginException {
        ...
            SAMLToken mySamlToken=someSAMLToken;
            ArrayList<SecurityToken> tokenList = 
                new ArrayList<SecurityToken>();
            tokenList.add(mySamlToken);
            _sharedState.put(
                Constants.WSSECURITY_TOKEN_TO_BE_INSERTED,
                tokenList);
        ...
          }
    1. GenericSecurityTokenFactory.putGeneratorTokenToSharedState メソッドを使用して、SAML トークンを _sharedState オブジェクトに書き込みます。
      import com.ibm.websphere.wssecurity.wssapi.token.GenericSecurityTokenFactory;
      
        public boolean login() throws LoginException {
      ...
        SAMLToken mySamlToken=someSAMLToken;
        GenericSecurityTokenFactory factory = GenericSecurityTokenFactory.getInstance();
        factory.putGeneratorTokenToSharedState(this._sharedState, mySamlToken);
      ...
        }

トピックのタイプを示すアイコン タスク・トピック



タイム・スタンプ・アイコン 最終更新: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=twbs_pass_samltoken
ファイル名:twbs_pass_samltoken.html