所提供的「表單 SSO 攔截程式」會以表單型登入頁面來鑑別使用者。以下是如何建立自訂 SSO 攔截程式的範例。自訂攔截程式會使用自訂攔截程式類別。
攔截程式類別會存取 WAS 來取得經過鑑別的使用者認證。取得這些認證之後,即會加以快取。後續登入會使用快取的認證。
如果要執行這項作業,請遵循以下指示:
<security-constraint id="SecurityConstraint_1"> <web-resource-collection id="WebResourceCollection_1"> <web-resource-name>/*</web-resource-name> <url-pattern>/AuthServlet/*</url-pattern> <http-method>GET</http-method> <http-method>POST</http-method> <http-method>PUT</http-method> <http-method>DELETE</http-method> </web-resource-collection> <auth-constraint id="AuthConstraint_1"> <description>myconstraint:+:</description> <role-name>User</role-name> </auth-constraint> <user-data-constraint id="UserDataConstraint_1"> <transport-guarantee>NONE</transport-guarantee> </user-data-constraint> </security-constraint> <login-config id="LoginConfig_1"> <auth-method>BASIC</auth-method> <realm-name>full-qualified-domain</realm-name> </login-config> <security-role id="SecurityRole_1"> <role-name>User</role-name> </security-role>
%IBM_JAVA_HOME%\jar -cvf rbf-services.war
您現在應該有新版的 rbf-services,其已修改來保護含有 J2EE 限制的 AuthServlet。請完成搭配 WAS 執行的安裝指示,並透過應用程式->安裝新的應用程式來安裝這個版本的 rbf-services.war。請確定在配置 WAS 時,Build Forge 不在執行中。
安裝此項目之後,請跳至應用程式->企業應用程式。按一下要配置的應用程式名稱。在明細內容下,按一下標題為使用者/群組對映的安全角色的鏈結。請對「使用者」選取所有已鑑別的使用者勾選框。進行這項變更之後,請務必儲存至主要配置。
WAS 下也需要啟用「應用程式安全」。若要執行這項作業,請移至安全->安全管理、應用程式和基礎架構。請務必勾選啟用應用程式安全。
若要設定對映,請定義環境,然後在攔截程式中參照該環境。
ldap_user_list_mapping = user1|root;user2|root;user3|root ldap_realm_name = bluepages.ibm.com:389
在此情況下,LDAP user1、user2 和 user3 全部都會對映到本端 root 使用者。
ldap_group_name_mapping = cn=bf_admin,ou=memberlist,ou=ibmgroups,o=ibm.com|root ldap_realm_name = bluepages.ibm.com:389
在此情況下,LDAP 群組 cn=bf_admin,ou=memberlist,ou=ibmgroups,o=ibm.com 的成員就會對映到本端 root 使用者。