有效用户的Tomcat安全约束 [英] Tomcat security constraint for valid user

查看:150
本文介绍了有效用户的Tomcat安全约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试保护tomcat中的资源,以便只有有效用户(在域中具有有效登录名和密码的用户)才能访问它。它们不一定属于领域中的一个群体。我已尝试使用< security-constraint> 指令的许多组合,但没有成功。有任何想法吗?

I'm trying to protect a resource in tomcat so that only "valid users" (those with a valid login and password in the realm) can access it. They do not necessarily belong to a group in the realm. I have tried with many combinations of the <security-constraint> directive without success. Any ideas?

推荐答案

除了你要添加到安全约束的auth-constraint:

Besides the auth-constraint you are adding to the security-constraint:

   <auth-constraint>
       <role-name>*</role-name>
   </auth-constraint>

您需要在网络应用中指定安全角色:

you need specify the security role in the web-app:

    <security-role>
        <role-name>*</role-name>
    </security-role>

这篇关于有效用户的Tomcat安全约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆