Configure Swagger-UI to Choose Spring HttpSecurity Exit Endpoint

I have Swagger and it works for all the controllers listed in my application. However, I want it to pick up the Spring Security exit point, and I cannot find a way to make it work. As you can see from the code snippet below, I specify logoutUrl so that the user invalidates their session. I tried class level annotation marking and method level, but no luck. Any ideas?

@Override public void configure(HttpSecurity http) throws Exception { http.addFilter(someFilter()); http.headers().and().csrf().disable() .authorizeRequests() .antMatchers("endpoint", "endpoint", "endpoint", "endpoint", "endpoint", "endpoint", "endpoint").permitAll() .anyRequest().authenticated() .and() .logout().logoutUrl("endpoint/logout").invalidateHttpSession(true).logoutSuccessHandler(logoutSuccessHandler); } 

My Swagger Docket configuration below:

 @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.any()) .paths(PathSelectors.any()) .build() .apiInfo(new ApiInfo("API", "Provides API's", "1.0", null, " someEmail@nowhere.com ", null, null)) .useDefaultResponseMessages(false) .pathProvider(new RelativePathProvider(servletContext) { @Override protected String applicationPath() { return super.applicationPath() + "/path"; } @Override protected String getDocumentationPath() { return super.getDocumentationPath() + "/path"; } }); } 
+5
source share
1 answer

The Spring Fox plugin uses Spring beans to create API documentation. Take a look at this answer: fooobar.com/questions/501201 / ...

0
source

All Articles