내 봄 - 보안 구현 HTTP는 소화 : 코드 : I 데이터베이스에서 사용자 데이터를 얻기 위해 그것을 사용자 정의하기 위해 노력하고있어데이터베이스 사용자가 DigestAuthenticationFilter를 사용할 수 있습니까? 대한
<bean id="digestFilter" class="org.springframework.security.web.authentication.www.DigestAuthenticationFilter">
<property name="userDetailsService" ref="userService"/>
<property name="authenticationEntryPoint" ref="digestEntryPoint"/>
</bean>
========================================================================
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider ref="inMemoryAuthenticationProvider"/>
</security:authentication-manager>
========================================================================
<bean id="inMemoryAuthenticationProvider"
class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
<property name="hideUserNotFoundExceptions" value="false"/>
<property name="userDetailsService" ref="inMemoryUserService"/>
<property name="messageSource" ref="messageSource"/>
</bean>
========================================================================
<security:user-service id="inMemoryUserService">
<security:user name="user" password="user" authorities="ROLE_USER"/>
<security:user name="admin" password="admin" authorities="ROLE_ADMIN"/>
<security:user name="invitado" password="invitado" authorities="ROLE_INVITADO"/>
</security:user-service>
합니다. UserDetailsService 인터페이스 클래스에서 액세스를 시도했습니다. 코드 : 보안을 구현할 때
public class CustomUserDetailsService implements UserDetailsService {
@Override
public UserDetails loadUserByUsername(String arg0)
throws UsernameNotFoundException {
List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
authorities.add(new SimpleGrantedAuthority("ROLE_USER"));
return new User(
"pepe",
"psw",
true,
true,
true,
true,
authorities);
}
}
이 레이블 때문에 작동하지 않습니다 : 사용자가 서비스를 더 클래스는 속성이 없습니다.
어떤 아이디어?, 사용자 데이터베이스에 액세스하는 방법?
귀하의 질문은 명확하지 않습니다. 'CustomUserDetailsService'의 bean을 생성 했습니까? –
안녕하세요, 이것은 xml 구성이 작동하지만 사용자가 코딩하고 있습니다. 사용자가 bbdd에 액세스해야합니다.이 액세스에 대한 제 아이디어는 CustomUserDetailsService 클래스입니다. – user1358518