2011-12-19 2 views
0

모든 저지 클라이언트 요청에 대해 스프링 데이터베이스 기반 인증을 구현하려고합니다. 난 내 web.xml 파일에 봄 보안 필터 체인을 추가 한,이 나의 봄 보안 컨텍스트 XML로 파일을스프링 데이터베이스 지원 인증 + 저지 클라이언트

내 문제는 내가 그 자격 증명을 사용자 (에 저장을 검색 할 MyUserDetailsService 클래스에
<authentication-manager> 
      <authentication-provider user-service-ref="myDetailsService"> 
        <jdbc-user-service data-source-ref="dataSource" /> 
      </authentication-provider> 
    </authentication-manager> 
    <beans:bean id="myDetailsService" class="myPackage.MyDetailsService"/> 

데이터베이스)는 저지 클라이언트가 보낸 것과 일치합니다. 내 impl :

class MyUserDetailsService implements UserDetailsService{ 
     public MyUserDetailsService(String username,String password){} 

    // i get the connexion from datasource 
    // and request user with corresponding username/password 
    // and return that user. 
} 

사용자를 만들 저지 클라이언트 요청에서 얻은 사용자 이름/암호를 어떻게 전달할 수 있습니까? (헤더 또는 쿼리 URL로 전송)

답변

0

AuthenticationUserDetailsService 클래스를 사용해 보셨습니까? loadUserDetails에 전달 된 Authentication 객체에는 사용자의 주요 ID와 자격 증명이 있습니다.

관련 문제