0
spring-boot에서 작동하는 UI가 아주 좋습니다. 모든 스프링 경로에 대한 역할에 따라 제한되는 내 스프링 휴식 API에 대한 상태 비 저장 인증 설정이 있습니다.Swager UI에 대한 액세스 제한
그러나 기본 인증 뒤에 <server_url>/swagger-ui.html
을 어떻게 넣을 수 있는지 잘 모르겠습니다.
내가 websecurity 다음 한
UPDATE는 구성이 SO 질문에서 인에 대한 자세한 내용을 모른 채 WebSecurityConfig
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity
.csrf().disable()
.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
.authorizeRequests()
.antMatchers("/sysadmin/**").hasRole("SYSADMIN")
.antMatchers("/admin/**").hasRole("ADMIN")
.antMatchers("/siteadmin/**").hasRole("SITEADMIN")
.antMatchers("/api/**").hasRole("USER")
.anyRequest().permitAll();
// Custom JWT based security filter
httpSecurity
.addFilterBefore(authenticationTokenFilterBean(), UsernamePasswordAuthenticationFilter.class);
}
일반적으로는 사람들이 당신의 설정에 대한 작업 솔루션을 제공 할 수 있도록 현재 보안 정의한 방법을 포함하여 가치가 추가 할 수 있도록 경로 아래에 자신감 파일을 넣어하는 것입니다. 그것을하는 많은 방법이 있습니다 그러나 당신의 imlementation에 관하여 더 많은 것이 도움이 될 것입니다 알고있는. –
업데이트 됨 내 질문 –