忍者ブログ

2024
09
10

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

2024/09/10 (Tue.)

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 -->
---------------------------------------------------------------------------------------------------------------------------------



PR

2009/02/16 (Mon.) Trackback() Comment(0) 未選択

Comments

名前
メールアドレス
URL
コメント
PASS  Vodafone絵文字 i-mode絵文字 Ezweb絵文字

Trackback

Trackback for this entry:

カレンダー

08 2024/09 10
S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30

リンク

カテゴリー

フリーエリア

最新CM

[08/09 VMAXON]

最新記事

最新TB

プロフィール

HN:
No Name Ninja
性別:
非公開

バーコード

RSS

ブログ内検索

アーカイブ

最古記事

アクセス解析

FX NEWS


-外国為替-

コガネモチ