Skip to content

Commit

Permalink
social: Workaround oauth compile error after Spring update
Browse files Browse the repository at this point in the history
  • Loading branch information
ato committed Nov 27, 2024
1 parent bb1ff8b commit 18f6655
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions social/src/pandas/PandasOAuthConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties;
import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientPropertiesRegistrationAdapter;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -12,9 +11,6 @@
import org.springframework.security.oauth2.client.InMemoryOAuth2AuthorizedClientService;
import org.springframework.security.oauth2.client.OAuth2AuthorizedClientManager;
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
import org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository;

import java.util.ArrayList;

/**
* Loads application-oauth.properties only if OIDC_URL is defined.
Expand All @@ -27,13 +23,15 @@
public class PandasOAuthConfig {

// For non-webapp mode. Spring Boot autoconfigures this in webapp mode.
@Bean
@ConditionalOnMissingBean(ClientRegistrationRepository.class)
InMemoryClientRegistrationRepository clientRegistrationRepository(OAuth2ClientProperties properties) {
var registrations = new ArrayList<>(
OAuth2ClientPropertiesRegistrationAdapter.getClientRegistrations(properties).values());
return new InMemoryClientRegistrationRepository(registrations);
}
// FIXME: broken in spring boot 3.4.0, we're not currently this so just commenting out for now
//
// @Bean
// @ConditionalOnMissingBean(ClientRegistrationRepository.class)
// InMemoryClientRegistrationRepository clientRegistrationRepository(OAuth2ClientProperties properties) {
// var registrations = new ArrayList<>(
// OAuth2ClientPropertiesRegistrationAdapter.getClientRegistrations(properties).values());
// return new InMemoryClientRegistrationRepository(registrations);
// }

// For non-webapp mode. Spring Boot autoconfigures this in webapp mode.
@Bean
Expand Down

0 comments on commit 18f6655

Please sign in to comment.