Zauważyłem, że istnieje kilka pytań dotyczących tego tematu. Przejrzałem je i nie mogłem zastosować ich do mojej specyficznej konfiguracji Spring. Chciałbym skonfigurować przekierowanie logowania, aby było warunkowe, w zależności od roli użytkownika. To, co mam tak daleko:Spring conditional default-target-url
<http auto-config="true" use-expressions="true">
<custom-filter ref="filterSecurityInterceptor" before="FILTER_SECURITY_INTERCEPTOR"/>
<access-denied-handler ref="accessDeniedHandler"/>
<form-login
login-page="/login"
default-target-url="/admin/index"
authentication-failure-url="/index?error=true"
/>
<logout logout-success-url="/index" invalidate-session="true"/>
</http>
Myślałem this question może być w tej samej linii, co usiłuję zrobić. Czy ktoś wie, jak mogę go zastosować?
EDIT 1
<bean id="authenticationProcessingFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
<property name="authenticationManager" ref="authenticationManager" />
<property name="authenticationSuccessHandler" ref="authenticationSuccessHandler"/>
</bean>
<bean id="authenticationSuccessHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler">
<property name="defaultTargetUrl" value="/login.jsp"/>
</bean>
EDIT 2
Obecnie nie mam klasę jak public class Test implements AuthenticationSuccessHandler {}
jak pokazano na this example.
Twoje pytanie jest identyczna [ten] (http://stackoverflow.com/questions/7470405/authenticationsuccesshandler-example-for-spring-security-3) –
Dziękuję. Czy możesz sprawdzić ** EDIT 1 **. Jestem zdezorientowany, ponieważ już przypisuję klasę wiosenną do tej fasoli? – ThreaT
Nie loguje się do autoryzacji uwierzytelniającej? http://static.springsource.org/spring-security/site/docs/3.0.x/reference/appendix-namespace.html –