Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 配置Swagger UI以拾取Spring';HTTPS安全注销终结点_Java_Spring_Spring Mvc_Spring Security_Swagger Ui - Fatal编程技术网

Java 配置Swagger UI以拾取Spring';HTTPS安全注销终结点

Java 配置Swagger UI以拾取Spring';HTTPS安全注销终结点,java,spring,spring-mvc,spring-security,swagger-ui,Java,Spring,Spring Mvc,Spring Security,Swagger Ui,我已经为我的应用程序中列出的所有控制器设置并工作了Swagger。但是,我希望它能够启动Spring安全注销端点,但我找不到让它工作的方法。正如您从下面的代码片段中看到的,我正在为用户指定一个logoutUrl以使其会话无效。我尝试过类级别的注释标记和方法级别,但没有成功。有什么想法吗 @Override public void configure(HttpSecurity http) throws Exception { http.addFilter(someFilter());

我已经为我的应用程序中列出的所有控制器设置并工作了Swagger。但是,我希望它能够启动Spring安全注销端点,但我找不到让它工作的方法。正如您从下面的代码片段中看到的,我正在为用户指定一个logoutUrl以使其会话无效。我尝试过类级别的注释标记和方法级别,但没有成功。有什么想法吗

@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);
}
我的招摇过市摘要配置如下:

@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";
                }
            });
}

SpringFox插件使用SpringBeans构建API文档。看看这个答案: