2011-08-15 6 views
0

Spring 3.0.5를 사용하여 LDAP 서버를 연결하는 가장 쉬운 방법은 무엇입니까?Spring 3.0.5를 사용하여 LDAP 서버를 연결하는 방법

의 ApplicationContext-security.xml는

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:s="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-2.0.xsd 
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> 

    //? how do I set this up 

</beans> 

web.xml을

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
    id="WebApp_ID" version="3.0"> 

    . 
    . 
    .//etc 

    <context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value> 
     /WEB-INF/applicationContext-security.xml 
     /WEB-INF/spring.xml 
    </param-value> 
    </context-param> 

    <filter> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 
    </filter> 

    <filter-mapping> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <url-pattern>/secure/*</url-pattern> 
    </filter-mapping> 

    . 
    . 
    .//etc 

</web-app> 

spring.xml는

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
    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"> 

    <bean id="configService" class="com.ConfigController"></bean> 

</beans> 
+0

LDAP 서버를 사용하여 인증을 수행하는 방법을 묻고 있습니까? 아니면인가? –

+0

감사합니다. MikeG. 본질적으로 둘 다 같아요. 나는 LDAP 서버가 어떻게 동작 하는지를 이해하기에 충분하지만 실제로는 지금까지 사용하지 않아야한다. 스프링을 연결하여 인증/인증을 받으려면 어떻게해야합니까? – stackoverflow

답변

0

같습니다 이미 Spring Security를 ​​사용하기로 결정한 것처럼 말입니다. 이미 LDAP Authentication과 협력하여 수업을 진행하고 있습니다. 스프링 시큐리티는 스프링 LDAP의 도우미 클래스를 사용하기 때문에 좀 더 맞춤화 할 수있는 다른 옵션이 필요하다.

또한 스프링 보안과 함께 DB 및 LDAP 액세스를 연결하는 방법이 있습니다. 이렇게하면 LDAP로 인증 할 수 있지만 "측면"데이터가 데이터베이스에 저장됩니다.

이미 기존 LDAP 설정이 있습니까? 즉, 함께 작업하고있는 스키마가 있습니까? 그렇지 않은 경우, 필요에 따라 LDAP를 설계하여 Spring 모델에 맞출 수 있습니다. 그러나 데이터베이스 (대부분 LDAP)와 마찬가지로 다른 문제가 발생할 수 있습니다.

+0

스키마가 사용 중입니다. 나는 xsd 파일을 가지고있다. 그러나 나는 봄 물건으로 그것들을 사용하는 방법조차 확신이 없다. 기꺼이 쉬운 경로를 택할 것입니다 (쉬운 단계별 튜토리얼을 알고있는 경우) – stackoverflow

+0

나는 XSD 파일이 아닌 데이터베이스 스키마와 같은 LDAP 스키마를 사용했습니다. 기존 LDAP에 사용자 (및 속성)가 이미 정의되어 있습니까? Spring Security 3 및 LDAP에 대한 자습서를 찾지 못해서. 문서를 18.4.5 절에서 시작할 수 있습니까? – AngerClown

관련 문제