diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientProperties.java index d9e13c08dbea..d57354581f3f 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientProperties.java @@ -40,7 +40,7 @@ public class OAuth2ClientProperties { private Map provider = new HashMap<>(); /** - * Client registrations. + * OAuth client registrations. */ private Map registration = new HashMap<>(); @@ -92,29 +92,29 @@ public static class Registration { private String clientSecret; /** - * The client authentication method. May be left bank then using a pre-defined + * Client authentication method. May be left bank then using a pre-defined * provider. */ private ClientAuthenticationMethod clientAuthenticationMethod; /** - * The authorization grant type. May be left bank then using a pre-defined + * Authorization grant type. May be left bank then using a pre-defined * provider. */ private AuthorizationGrantType authorizationGrantType; /** - * The redirect URI. May be left bank then using a pre-defined provider. + * Redirect URI. May be left bank then using a pre-defined provider. */ private String redirectUri; /** - * The authorization scopes. May be left bank then using a pre-defined provider. + * Authorization scopes. May be left bank then using a pre-defined provider. */ private Set scope; /** - * The client name. May be left bank then using a pre-defined provider. + * Client name. May be left bank then using a pre-defined provider. */ private String clientName; @@ -189,28 +189,28 @@ public void setClientName(String clientName) { public static class Provider { /** - * The authorization URI for the provider. + * Authorization URI for the provider. */ private String authorizationUri; /** - * The token URI for the provider. + * Token URI for the provider. */ private String tokenUri; /** - * The user info URI for the provider. + * User info URI for the provider. */ private String userInfoUri; /** - * The name of the attribute that will be used to extract the username from the + * Name of the attribute that will be used to extract the username from the * call to 'userInfoUri'. */ private String userNameAttribute; /** - * The JWK set URI for the provider. + * JWK set URI for the provider. */ private String jwkSetUri; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesRegistrationAdapter.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesRegistrationAdapter.java index 1a812e9637ed..5a3a326c7b50 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesRegistrationAdapter.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesRegistrationAdapter.java @@ -57,10 +57,10 @@ private static ClientRegistration getClientRegistration(String registrationId, R providers); copyIfNotNull(properties::getClientId, builder::clientId); copyIfNotNull(properties::getClientSecret, builder::clientSecret); - copyIfNotNull(() -> properties.getClientAuthenticationMethod(), + copyIfNotNull(properties::getClientAuthenticationMethod, builder::clientAuthenticationMethod, ClientAuthenticationMethod::getMethod); - copyIfNotNull(() -> properties.getAuthorizationGrantType(), + copyIfNotNull(properties::getAuthorizationGrantType, builder::authorizationGrantType, AuthorizationGrantType::getType); copyIfNotNull(properties::getRedirectUri, builder::redirectUri); copyIfNotNull(properties::getScope, builder::scope, diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2WebSecurityConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2WebSecurityConfiguration.java index 3b4a1771a2f5..544a7f0ce66c 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2WebSecurityConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2WebSecurityConfiguration.java @@ -36,7 +36,7 @@ class OAuth2WebSecurityConfiguration { @Configuration - private static class OAuth2WebSecurityConfigurationAdapter extends WebSecurityConfigurerAdapter { + static class OAuth2WebSecurityConfigurationAdapter extends WebSecurityConfigurerAdapter { private final ClientRegistrationRepository clientRegistrationRepository; diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 7ef4ea34f141..3f4551b2c262 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -484,6 +484,10 @@ content into your application; rather pick only the properties that you need. spring.security.filter.order=0 # Security filter chain order. spring.security.filter.dispatcher-types=ASYNC,ERROR,REQUEST # Security filter chain dispatcher types. + # SECURITY OAUTH2 CLIENT ({sc-spring-boot-autoconfigure}/security/oauth2/client/OAuth2ClientProperties.{sc-ext}[OAuth2ClientProperties]) + spring.security.oauth2.client.provider.*= # OAuth provider details. + spring.security.oauth2.client.registration.*= # OAuth client registrations. + # ---------------------------------------- # DATA PROPERTIES # ----------------------------------------