【问题标题】:Configuring sample webcontext with JOSSO+TOMCAT使用 JOSSO+TOMCAT 配置示例 webcontext
【发布时间】:2012-01-20 06:59:01
【问题描述】:

JOSSO 的新手。我已经用 tomcat 设置了 JOSSO,并且 partnerapp 似乎工作正常。我有一个“示例”网络应用程序,我正在尝试使用 JOSSO 进行配置。当我尝试访问 web 应用程序时,JOSSO 登录页面正确显示,但是 在我成功登录后,我得到以下异常

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-agent-config.xml。

<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:\tomcat_dir\conf\Catlina\localhost 中创建了一个 sample.xml 文件,如下所示

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

如有任何关于此问题的反馈,我们将不胜感激。

交叉发布于JOSSO forum

【问题讨论】:

  • 我刚刚注释掉了以下行,它似乎工作正常。 我猜该行试图使用其他数据库进行用户身份验证,而我想使用来自 josso-users 的默认用户。 xml 文件。

标签: tomcat josso


【解决方案1】:

您应该在 tomcat 初始化时指明 jaas.conf 文件,方法是在 VM Arguments 上添加以下参数(如果您使用的是 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,因此我在服务器配置(查看服务器)/打开启动配置/参数/VM 参数中包含了上述配置。 但是,如果您正在配置独立的 tomcat 安装,请通过 %TOMCAT_HOME$/bin/scripts e 浏览并检查正在使用的 jaas.conf tomcat 并使用上面显示的内容对其进行更新。 我希望它对你有用!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-05
    • 2011-06-24
    • 1970-01-01
    相关资源
    最近更新 更多