2025
					11
					01
				
					2009
					02
					16
				
[Tomcat][SSO] JossoでSSO
						JOSSOをダウンロードする
とりあえず、 			apache-tomcat-6.0.18_josso-1.8.0をダウンロードすれば、すぐJOSSOで確認できる。
サンプルとして、webappディレクトリ以下にjossoとpartnerappがある。
http://localhost:8080/josso
http://localhost:8080/partnerapp
などとすることで、ログイン画面が表示されることを確認できる。
webapp/examplesを認証させる。
/lib/josso-agent-config.xml に以下追加する
<agent:partner-apps>
    <!-- 以下追加 -->
    <agent:partner-app id="Examples" context="/examples">
        <ignore-web-resource-collections>public-resources,img-resources</ignore-web-resource-collections>
    </agent:partner-app>
    <!-- 以上追加 -->
/webapps/examples/WEB-INF/web.xml 以下のように修正する。
---------------------------------------------------------------------------------------------------------------------------------
<!-- for SSO -->
    <security-constraint>
        <!-- Sample Security Constraint -->
        <web-resource-collection>
            <!-- We're going to protect this resource and make it available only to users in "role1". -->
            <web-resource-name>protected-resources</web-resource-name>
            <url-pattern>/*</url-pattern>
            <!--
            <url-pattern>/jsp/*</url-pattern>
            <url-pattern>/servlets/*</url-pattern>
            -->
            <http-method>HEAD</http-method>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
            <http-method>PUT</http-method>
            <http-method>DELETE</http-method>
        </web-resource-collection>
        <!-- NOTE: This role names will be retrieved by Josso using the proper identity store. -->
        <auth-constraint>
            <role-name>role1</role-name>
        </auth-constraint>
        <user-data-constraint>
            <transport-guarantee>NONE</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
<!-- for SSO -->
    <!-- Default login configuration uses form-based authentication -->
    <!-- We only need tomcat to redirect the user -->
<!-- for SSO -->
    <login-config>
        <auth-method>FORM</auth-method>
        <form-login-config>
            <!--
            NOTE: This will redirect the user to the proper login page provided by JOSSO.
            -->
            <form-login-page>/login-redirect.jsp</form-login-page>
            <form-error-page>/login-redirect.jsp</form-error-page>
        </form-login-config>
    </login-config>
<!-- for SSO -->
---------------------------------------------------------------------------------------------------------------------------------
2009/02/16 (Mon.) Trackback() Comment(0) 未選択
Comments
Trackback
Trackback for this entry:
 
	
	