13.7.3. ID プロバイダーの設定
アイデンティティープロバイダー(IDP)は JBoss EAP サーバーインスタンスです。
手順13.1 アイデンティティープロバイダー(IDP)の設定
IDP の Web アプリケーションセキュリティーの設定
Web アプリケーションを ID プロバイダーとして設定します。注記FORM ベースの Web アプリケーションセキュリティーの使用が推奨されます。ログインページをカスタマイズすることができます。web.xml
設定の例を以下に示します。例13.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
ファイルの例になります。例13.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
の設定例です。この設定ファイルで、送信 SAML2 アサーションの発行者としてサービスプロバイダーと IDP に発行者として追加される URL を提供します。例13.8
picketlink.xml
Configuration<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
の valve 要素に 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
)。Web アプリケーションには、PicketLink クラスを配置するためにMETA-INF/MANIFEST.MF
またはjboss-deployment-structure.xml
を定義する依存関係も必要です。例13.9
META-INF/MANIFEST.MF
への依存関係の定義Manifest-Version: 1.0 Build-Jdk: 1.6.0_24 Dependencies: org.picketlink
例13.10
META-INF/jboss-deployment-structure.xml
で依存関係を定義<jboss-deployment-structure> <deployment> <dependencies> <module name="org.picketlink" /> </dependencies> </deployment> </jboss-deployment-structure>