简体   繁体   中英

multiple <security:http> section in spring security configuration file

I am trying to configure 2 different authentication types in my spring security xml file. 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

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Duplicate element detected

I am using Spring Security 3.0.5 and the xml schema is

<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.

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 . The author wants to authenticate with LDAP and database.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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