与 Apache Tomcat 相关的 Spring 安全性 tomcat-users.xml UserDatabaseRealm [英] Spring security tied to Apache Tomcat tomcat-users.xml UserDatabaseRealm

查看:36
本文介绍了与 Apache Tomcat 相关的 Spring 安全性 tomcat-users.xml UserDatabaseRealm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在向内部网站添加 Spring 安全性.我被要求将身份验证绑定到 tomcat-users.xml,以便我们可以减少要更改/记住的密码数量.

I'm adding Spring security to an internal website. I've been asked to have the authentication be tied to tomcat-users.xml, so that we can cut down on the number of passwords to change/remember.

根据我在 Google 上的了解,如果可能的话,这并不是很直接.

From what I've been able to Google up, this isn't very straighforward, if at all possible.

目前一切正常,在 springSecurity.xml 中硬编码了用户 + 角色.

Things are working fine, for now, with a user + role hardcoded in springSecurity.xml.

推荐答案

您可以将容器安全视为 预认证场景.

You can treat container security as a pre-authenticated scenario.

代码库中有一个 示例应用 使用它方法.它使用显式 bean 配置,但也有一个 命名空间元素 可用.

There's a sample app in the codebase which uses this approach. It uses explicit bean configuration, but there is also a <jee> namespace element available.

这篇关于与 Apache Tomcat 相关的 Spring 安全性 tomcat-users.xml UserDatabaseRealm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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