use of com.evolveum.midpoint.authentication.impl.entry.point.RemoteAuthenticationEntryPoint in project midpoint by Evolveum.
the class RemoteModuleWebSecurityConfigurer method configure.
@Override
protected void configure(HttpSecurity http) throws Exception {
super.configure(http);
http.antMatcher(AuthUtil.stripEndingSlashes(getPrefix()) + "/**");
http.csrf().disable();
MidpointExceptionHandlingConfigurer exceptionConfigurer = new MidpointExceptionHandlingConfigurer() {
@Override
protected Authentication createNewAuthentication(AnonymousAuthenticationToken anonymousAuthenticationToken) {
if (anonymousAuthenticationToken.getDetails() != null && getAuthTokenClass().isAssignableFrom(anonymousAuthenticationToken.getDetails().getClass())) {
return (Authentication) anonymousAuthenticationToken.getDetails();
}
return null;
}
};
getOrApply(http, exceptionConfigurer).authenticationEntryPoint(new RemoteAuthenticationEntryPoint(getAuthEntryPointUrl()));
http.logout().clearAuthentication(true).logoutRequestMatcher(new AntPathRequestMatcher(getPrefix() + "/logout")).invalidateHttpSession(true).deleteCookies("JSESSIONID").logoutSuccessHandler(getLogoutRequestSuccessHandler());
}
Aggregations