简体   繁体   English

多 <security:http> spring安全配置文件中的一节

[英]multiple <security:http> section in spring security configuration file

I am trying to configure 2 different authentication types in my spring security xml file. 我试图在我的spring security xml文件中配置2种不同的身份验证类型。 One for BASIC and the other Kerberos, both of them work fine when when only one is configured but getting the following error when configuring both in the same file 一个用于BASIC,另一个用于Kerberos,当仅配置一个时,它们都可以正常工作,但是在同一个文件中同时配置这两个时,会出现以下错误

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Duplicate element detected org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:检测到重复元素

I am using Spring Security 3.0.5 and the xml schema is 我正在使用Spring Security 3.0.5,而xml模式是

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security 
http://www.springframework.org/schema/security/spring-security-3.0.xsd">

Can someone advice how to configure multiple security:http section and authentication managers in one application. 有人可以建议如何在一个应用程序中配置多个安全性:http部分和身份验证管理器。

Maybe you can add multiple authentication providers like in this post ? 也许您可以像这篇文章中添加多个身份验证提供程序?

Then you'll have one security tag but with multiple authentication options. 然后,您将拥有一个安全标签,但具有多个身份验证选项。

EDIT 编辑

I've found similar problem at Stackoverflow . 我在Stackoverflow上发现了类似的问题。 The author wants to authenticate with LDAP and database. 作者想通过LDAP和数据库进行身份验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM