SAML SP-Initiated Web シングル・サインオン (SSO) の使用可能化

デフォルトで、WebSphere® Application Server の SAML トラスト・アソシエーション・インターセプター (TAI) は、IdP-initiated SSO をサポートします。カスタム・コードが適所にある場合、SP-initiated SSO をサポートするように SAML TAI を構成することができます。

始める前に

このタスクは、システムで SAML Web SSO 機能の使用を有効にしていることを前提としています。まだこの作業を行っていない場合は、システムでの SAML Web シングル・サインオン (SSO) 機能の使用可能化を参照してください。

このタスクについて

このタスクでは、サンプル・クラスと、SP-initiated SSO を構成するための手順を提供します。

手順

  1. com.ibm.wsspi.security.web.saml.AuthnRequestProvider インターフェースを実装する SAML 認証要求プロバイダーを開発します。
    メソッド getAuthnRequest(HttpServletRequest req, String errorMsg, String acsUrl, ArrayList<String> ssoUrls) は、次のキーを持つ 4 つのエントリーを含むマップを返す必要があります。
    AuthnRequestProvider.SSO_URL
    SAML ID プロバイダーのシングル・サインオン URL。
    AuthnRequestProvider.RELAY_STATE
    SAML Web ブラウザーのシングル・サインオン・プロファイルによって定義された relayState
    AuthnRequestProvider.REQUEST_ID
    このキーの値は、AuthnRequest メッセージ内の ID 属性の値に一致している必要があります。
    AuthnRequestProvider.AUTHN_REQUEST
    仕様に定義されている、Base64 エンコードの AuthnRequest メッセージ。コードは、AuthnRequest メッセージを生成する責任を持ちます。
                    public HashMap <String, String> getAuthnRequest(HttpServletRequest req, String errorMsg, 
    			   String acsUrl, ArrayList<String> ssoUrls)
    	        throws NotImplementedException {
    	   
    	        //create map with following keys
    	        HashMap <String, String> map = new HashMap <String, String>();
    	       
    	        String ssoUrl = "https://example.com/saml20/Login";
    	        map.put(AuthnRequestProvider.SSO_URL, ssoUrl);
    
    	        String relayState = generateRandom();
    	        map.put(AuthnRequestProvider.RELAY_STATE, relayState);
    
    	        String requestId = generateRandom();
    	        map.put(AuthnRequestProvider.REQUEST_ID, requestId);
    	        
    	        //create AuthnRequest	        	        
    	        String authnMessage = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    				   +"<samlp:AuthnRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" "
    				   +"ID=\""+requestID+"\" Version=\"2.0\" "
    				   + "IssueInstant=\"" +getUTC()+ "\" ForceAuthn=\"false\" IsPassive=\"false\""
    				   + "ProtocolBinding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\" "
    				   + "AssertionConsumerServiceURL=\"" +acs+"\" "
    				   + "Destination=\"" +destination +"\"> "
    				   + "<saml:Issuer xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">"
    				   + issuer
    				   +"</saml:Issuer> <samlp:NameIDPolicy"
    				   +"Format=\"urn:oasis:names:tc:SAML:2.0:nameid-format:transient\""
    				   +"SPNameQualifier=\"mysp\""
    				   +"AllowCreate=\"true\" /> <samlp:RequestedAuthnContext Comparison=\"exact\"> "
    				   +"<saml:AuthnContextClassRef xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">"
    			         +"urn:oasis:names:tc:SAML:2.0:ac:classes:</samlp:RequestedAuthnContext> </samlp:AuthnRequest>";
    
    	        map.put(AuthnRequestProvider.AUTHN_REQUEST, authnMessage);
                    return map;
    	        }
  2. カスタム・クラスを含む jar ファイルを (WAS_HOME)/lib/ext ディレクトリーに入れます。
  3. AuthnRequest メッセージを使用するように SAML Web SSO TAI を構成します。
    1. WebSphere Application Server 管理コンソールにログオンします。
    2. 「セキュリティー」>「グローバル・セキュリティー」とクリックします。
    3. 「Web および SIP セキュリティー」を展開し、「トラスト・アソシエーション」をクリックします。
    4. 「インターセプター」をクリックします。
    5. 「com.ibm.ws.security.web.saml.ACSTrustAssociationInterceptor」をクリックします。
    6. 「カスタム・プロパティー」「新規」をクリックし、次に、以下のカスタム・プロパティー情報を完了します。ここで、id は、このプロパティーを適用する SSO サービス・プロバイダー (SP) に割り当てた ID です。
      • 名前: sso_<id>.sp.login.error.page
      • 値: カスタム AuthnRequestProvider 実装のクラス名。

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



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