|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/** |
|
|
|
* Copyright © 2016-2022 The Thingsboard Authors |
|
|
|
* Copyright © 2016-2023 The Thingsboard Authors |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -30,6 +30,7 @@ import org.springframework.security.config.annotation.authentication.builders.Au |
|
|
|
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; |
|
|
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
|
|
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; |
|
|
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer; |
|
|
|
import org.springframework.security.config.http.SessionCreationPolicy; |
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
|
|
|
import org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestResolver; |
|
|
|
@ -181,15 +182,8 @@ public class ThingsboardSecurityConfiguration { |
|
|
|
private OAuth2AuthorizationRequestResolver oAuth2AuthorizationRequestResolver; |
|
|
|
|
|
|
|
@Bean |
|
|
|
@Order(0) |
|
|
|
SecurityFilterChain resources(HttpSecurity http) throws Exception { |
|
|
|
http |
|
|
|
.requestMatchers((matchers) -> matchers.antMatchers("/*.js","/*.css","/*.ico","/assets/**","/static/**")) |
|
|
|
.authorizeHttpRequests((authorize) -> authorize.anyRequest().permitAll()) |
|
|
|
.requestCache().disable() |
|
|
|
.securityContext().disable() |
|
|
|
.sessionManagement().disable(); |
|
|
|
return http.build(); |
|
|
|
public WebSecurityCustomizer webSecurityCustomizer() { |
|
|
|
return (web) -> web.ignoring().antMatchers("/*.js","/*.css","/*.ico","/assets/**","/static/**"); |
|
|
|
} |
|
|
|
|
|
|
|
@Bean |
|
|
|
|