2012-01-20 25 views
0

JOSSO的新手。我用tomcat設置了JOSSO,並且partnerapp似乎正常工作。我有一個'示例'webapp,我正在嘗試使用JOSSO進行配置。當我嘗試訪問web應用程序然而後,我登錄成功,我得到下面的異常用JOSSO + TOMCAT配置示例webcontext

java.lang.RuntimeException: Outbound relaying failed. No Principal found. Verify your SSO Agent Configuration! 
    org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:551) 
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) 
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) 
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) 
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) 
    java.lang.Thread.run(Thread.java:722) 

我加入了合作伙伴的應用程序進入josso代理-config.xml中的JOSSO登錄頁面正確顯示。

<agent:partner-app id="MySampleApp" context="/sample"/> 

我的web.xml文件看起來像這樣

... 
    <welcome-file-list id="WelcomeFileList"> 
     <welcome-file>index.html</welcome-file> 
    </welcome-file-list> 

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

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

    <security-role > 
     <description>Role 1</description> 
     <role-name>role1</role-name> 
    </security-role> 

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

創建在C sample.xml中的文件:\ TOMCAT_DIR \的conf \ Catlina \本地主機看起來像這樣

<Context docBase="${catalina.home}/webapps/sample" privileged="true" antiResourceLocking="true" antiJARLocking="true"> 
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> 
</Context> 

任何對這個問題的反饋將不勝感激。

Crossposted上JOSSO forum

+1

我剛剛註釋掉了下面這行,它似乎工作正常。 我想這行嘗試使用其他數據庫進行用戶身份驗證,而我想使用josso用戶的默認用戶。 xml文件。 –

回答

0

你應該表明在Tomcat初始化jaas.conf文件中,加入對VM參數以下參數(如果你使用Eclipse):

-Djava.security.auth.login.config=D:\apache-tomcat-7.0.54-josso\conf\jaas.conf 

這個文件,應該有以下內容:

josso { 
    org.josso.tc70.agent.jaas.SSOGatewayLoginModule required debug=true; 
}; 

我使用的是由Eclipse IDE管理的Tomcat,所以我將上述配置包含在Se rver配置(查看服務器)/打開啓動配置/參數/ VM參數。 但是,如果您正在配置獨立的tomcat安裝,請瀏覽%TOMCAT_HOME $/bin/scripts e並檢查tomcat正在使用哪個jaas.conf並使用上面顯示的內容進行更新。 我希望它適合你!