15.7.3. アイデンティティープロバイダーの設定

アイデンティティープロバイダーは JBoss EAP サーバーインスタンスです。

手順15.1 アイデンティティープロバイダー (IDP) の設定

  1. IDP の Web アプリケーションセキュリティーの設定

    Web アプリケーションをアイデンティティープロバイダーとして設定します。

    注記

    ログインページをカスタマイズできるため、FORM ベースの Web アプリケーションセキュリティーを使用することが推奨されます。
    web.xml の設定例は次のとおりです。

    例15.6 IDP の web.xml 設定

    <display-name>IDP</display-name>
    <description>IDP</description>
    <!-- Define a security constraint that gives unlimited access to images -->
    <security-constraint>
      <web-resource-collection>
      <web-resource-name>Images</web-resource-name>
      <url-pattern>/images/*</url-pattern>
    </web-resource-collection>
    </security-constraint>
    <!-- Define a Security Constraint on this Application -->
    <security-constraint>
      <web-resource-collection>
      <web-resource-name>IDP</web-resource-name>
      <url-pattern>/*</url-pattern>
    </web-resource-collection>
      <auth-constraint>
      <role-name>manager</role-name>
    </auth-constraint>
    </security-constraint>
    <!-- Define the Login Configuration for this Application -->
    <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>IDP Application</realm-name>
      <form-login-config>
        <form-login-page>/jsp/login.jsp</form-login-page>
        <form-error-page>/jsp/loginerror.jsp</form-error-page>
      </form-login-config>
    </login-config>
    <!-- Security roles referenced by this web application -->
    <security-role>
     <description>
      The role that is required to log in to the IDP Application
     </description>
     <role-name>manager</role-name>
    </security-role>
    </web-app>
  2. IDP のセキュリティードメインの作成

    IDP に対して定義された認証および承認メカニズムを用いてセキュリティードメインを作成します。詳細は「アプリケーションでのセキュリティードメインの使用」を参照してください。
  3. IDP バルブの設定

    IDP Web アプリケーションの WEB-INF ディレクトリーで jboss-web.xml ファイルを作成し、IDP のバルブを設定します。以下に jboss-web.xml ファイルの例を示します。

    例15.7 IDP バルブの jboss-web.xml ファイル設定

    <jboss-web>
      <security-domain>idp</security-domain>
      <context-root>idp</context-root>
      <valve>
        <class-name>org.picketlink.identity.federation.bindings.tomcat.idp.IDPWebBrowserSSOValve</class-name>
      </valve>
    </jboss-web>
  4. PicketLink 設定ファイル (picketlink.xml) の設定

    以下は picketlink.xml 設定の例になります。この設定ファイルで、サービスプロバイダーおよび IDP へ送信される SAML2 アサーションに発行者として追加される URL を指定します。

    例15.8 picketlink.xml 設定

    <PicketLink xmlns="urn:picketlink:identity-federation:config:2.1">
      <PicketLinkIDP xmlns="urn:picketlink:identity-federation:config:2.1">
        <IdentityURL>http://localhost:8080/idp/</IdentityURL>
      </PicketLinkIDP>
      <Handlers xmlns="urn:picketlink:identity-federation:handler:config:2.1">
        <Handler class="org.picketlink.identity.federation.web.handlers.saml2.SAML2IssuerTrustHandler" />
        <Handler class="org.picketlink.identity.federation.web.handlers.saml2.SAML2LogOutHandler" />
        <Handler class="org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler" />
        <Handler class="org.picketlink.identity.federation.web.handlers.saml2.RolesGenerationHandler" />
      </Handlers>
    </PicketLink>
    デフォルトでは、picketlink.xml は IDP Web アプリケーションの WEB-INF ディレクトリーにありますが、アプリケーションの外部にある picketlink.xml へのカスタムパスを設定できます。
    1. 任意設定: picketlink.xml へのカスタムパスの設定

      アプリケーションの WEB-INF/jboss-web.xml でバルブ要素に、configFiletimerInterval の 2 つのパラメーターを追加します。configFilepicketlink.xml へのパスを指定し、timerInterval は設定を再ロードする間隔をミリ秒単位で指定します。例を以下に示します。
      <valve>
        <class-name>...</class-name>
          <param>
            <param-name>timerInterval</param-name>
            <param-value>5000</param-value>
          </param>
          <param>
            <param-name>configFile</param-name>
            <param-value>path-to/picketlink.xml</param-value>
          </param>
      </valve>
  5. PicketLink モジュール (META-INF/MANIFEST.MF または jboss-deployment-structure.xml) での依存関係の宣言

    PicketLink クラスの場所を特定できるようにするため、Web アプリケーションには META-INF/MANIFEST.MF または jboss-deployment-structure.xml に定義される依存関係が必要です。

    例15.9 META-INF/MANIFEST.MF での依存関係の定義

    Manifest-Version: 1.0
        Build-Jdk: 1.6.0_24
        Dependencies: org.picketlink

    例15.10 META-INF/jboss-deployment-structure.xml での依存関係の定義

    <jboss-deployment-structure>  
      <deployment>    
        <dependencies>
          <module name="org.picketlink" />
        </dependencies>
      </deployment>
    </jboss-deployment-structure>