Skip to content

Commit

Permalink
fix: Fix runtime error with missing ClientRegistrationRepository bean
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Kopysov <o.kopysov@samsung.com>
  • Loading branch information
o-kopysov committed Feb 29, 2024
1 parent bc7542d commit 95d19a7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/com/lpvs/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
Expand Down Expand Up @@ -139,4 +140,14 @@ public CorsConfigurationSource corsConfigurationSource() {
source.registerCorsConfiguration("/**", configuration);
return source;
}

/**
* Defines a simple ClientRegistrationRepository that always returns null for any registration ID.
*
* @return ClientRegistrationRepository bean.
*/
@Bean
public ClientRegistrationRepository clientRegistrationRepository() {
return registrationId -> null;
}
}

0 comments on commit 95d19a7

Please sign in to comment.