15.7.3. アイデンティティープロバイダーの設定
アイデンティティープロバイダーは JBoss EAP サーバーインスタンスです。
手順15.1 アイデンティティープロバイダー (IDP) の設定
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>IDP のセキュリティードメインの作成
IDP に対して定義された認証および承認メカニズムを用いてセキュリティードメインを作成します。詳細は「アプリケーションでのセキュリティードメインの使用」を参照してください。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>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へのカスタムパスを設定できます。任意設定:
picketlink.xmlへのカスタムパスの設定アプリケーションのWEB-INF/jboss-web.xmlでバルブ要素に、configFileとtimerIntervalの 2 つのパラメーターを追加します。configFileはpicketlink.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>
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>