Commit 7929a935 authored by Jason Song's avatar Jason Song Committed by GitHub

add prometheus integration and fix the logout issue for ldap (#2638)

parent 9636d5f5
...@@ -403,13 +403,12 @@ public class AuthConfiguration { ...@@ -403,13 +403,12 @@ public class AuthConfiguration {
http.csrf().disable(); http.csrf().disable();
http.headers().frameOptions().sameOrigin(); http.headers().frameOptions().sameOrigin();
http.authorizeRequests() http.authorizeRequests()
.antMatchers("/openapi/**", "/vendor/**", "/styles/**", "/scripts/**", "/views/**", "/img/**").permitAll() .antMatchers("/prometheus/**","/metrics/**","/openapi/**", "/vendor/**", "/styles/**", "/scripts/**", "/views/**", "/img/**").permitAll()
.antMatchers("/**").authenticated(); .antMatchers("/**").authenticated();
http.formLogin().loginPage("/signin").permitAll().failureUrl("/signin?#/error").and().httpBasic(); http.formLogin().loginPage("/signin").defaultSuccessUrl("/", true).permitAll().failureUrl("/signin?#/error").and()
SimpleUrlLogoutSuccessHandler urlLogoutHandler = new SimpleUrlLogoutSuccessHandler(); .httpBasic();
urlLogoutHandler.setDefaultTargetUrl("/signin?#/logout");
http.logout().logoutUrl("/user/logout").invalidateHttpSession(true).clearAuthentication(true) http.logout().logoutUrl("/user/logout").invalidateHttpSession(true).clearAuthentication(true)
.logoutSuccessHandler(urlLogoutHandler); .logoutSuccessUrl("/signin?#/logout");
http.exceptionHandling().authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/signin")); http.exceptionHandling().authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/signin"));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment