【问题标题】:How to set up a password for openrdf workbench?如何为 openrdf 工作台设置密码?
【发布时间】:2011-04-09 22:39:32
【问题描述】:

我已经成功安装了Openrdf Repository (sesame 2.3.2) 和 Openrdf 工作台,但是我不知道如何设置用户和密码来保护 Openrdf 工作台。我想有 --somewhere -- 一个配置文件。

谁能给我一个提示,如何为 openrdf 工作台创建用户并设置密码?

【问题讨论】:

    标签: configuration passwords rdf semantics sesame


    【解决方案1】:

    我相信您需要在 servlet 容器级别进行密码保护。你用的是Tomcat吗?以下是我使用 Tomcat 6 设置基本身份验证的方法:

    web.xml

    <security-constraint>
      <web-resource-collection>
        <web-resource-name>Sesame Workbench</web-resource-name>
        <url-pattern>/*</url-pattern>
      </web-resource-collection>
      <auth-constraint>
        <role-name>sesame-user</role-name>
      </auth-constraint>
    </security-constraint>          
    
    <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>Sesame Workbench</realm-name>
    </login-config>
    
    <security-role>
      <description>The role required for Sesame workbench</description>
      <role-name>sesame-user</role-name>
    </security-role>
    

    tomcat-users.xml

    <role rolename="sesame-user"/>
    <user username="workbench" password="workbench" roles="sesame-user"/>
    

    【讨论】:

    • 我不知道为什么,但它不起作用。我的意思是我可以在不提供用户名和密码的情况下打开工作台。
    • 我的错,我认为某些东西不经过测试就可以工作。似乎您不能使用主 web.xml 来保护单个 webapp URL(但您可以使用 /* 来保护 Tomcat 提供的所有内容)。因此,如果您只想保护工作台,您可以将上述 sn-p 添加到该 webapp 的 web.xml(例如 webapps/openrdf-workbench/WEB-INF/web.xml)。
    猜你喜欢
    • 1970-01-01
    • 2016-05-27
    • 1970-01-01
    • 2023-03-18
    • 1970-01-01
    • 1970-01-01
    • 2021-06-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多