Skip to content

Commit

Permalink
imporve securityMatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
mucsi96 committed Jul 15, 2023
1 parent 5bf0b6c commit c9762fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class SecurityConfiguration {
SecurityFilterChain securityFilterChain(
HttpSecurity http,
KubetoolsSecurityConfigurer kubetoolsSecurityConfigurer) throws Exception {
return kubetoolsSecurityConfigurer.configure(http).securityMatcher("/weight/**", "/withings/sync").build();
return kubetoolsSecurityConfigurer.configure(http).securityMatcher("/weight/**").build();
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package mucsi96.traininglog.withings.oauth;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.client.OAuth2AuthorizedClientManager;
import org.springframework.security.oauth2.client.OAuth2AuthorizedClientProvider;
Expand All @@ -24,7 +22,7 @@ SecurityFilterChain withingsSecurityFilterChain(
KubetoolsSecurityConfigurer kubetoolsSecurityConfigurer,
WithingsAccessTokenResponseClient accessTokenResponseClient) throws Exception {
return kubetoolsSecurityConfigurer.configure(http)
.securityMatcher("/withings/authorize")
.securityMatcher("/withings/**")
.oauth2Client(configurer -> configurer
.authorizationCodeGrant(customizer -> customizer
.accessTokenResponseClient(accessTokenResponseClient)))
Expand Down

0 comments on commit c9762fb

Please sign in to comment.