@@ -2846,7 +2846,7 @@ You can register multiple OAuth2 clients and providers under the
28462846
28472847[source,properties,indent=0]
28482848----
2849- spring.security.oauth2.client.registration.my-client-1.client-id: =abcd
2849+ spring.security.oauth2.client.registration.my-client-1.client-id=abcd
28502850 spring.security.oauth2.client.registration.my-client-1.client-secret=password
28512851 spring.security.oauth2.client.registration.my-client-1.client-name=Client for user scope
28522852 spring.security.oauth2.client.registration.my-client-1.provider=my-oauth-provider
@@ -2871,10 +2871,25 @@ You can register multiple OAuth2 clients and providers under the
28712871 spring.security.oauth2.client.provider.my-oauth-provider.user-name-attribute=name
28722872----
28732873
2874- NOTE: For common OAuth2 and OpenID providers such as Google, Github, Facebook and Okta,
2875- we provide a set of provider defaults. If you don't need to customize these providers, you
2876- do not need to provide the `provider` configuration. The client registration `provider`
2877- key should reference one these providers.
2874+ For common OAuth2 and OpenID providers such as Google, Github, Facebook and Okta,
2875+ we provide a set of provider defaults (`google`, `github`, `facebook` and `okta`
2876+ respectively).
2877+
2878+ If you don't need to customize these providers, you can set the `provider` attribute to
2879+ the one you need to infer defaults. Also if the id of your client matches one the
2880+ out-of-the-box supported provider, we'll infer that as well.
2881+
2882+ In other words, these two configurations will use the Google provider:
2883+
2884+ [source,properties,indent=0]
2885+ ----
2886+ spring.security.oauth2.client.registration.my-client.client-id=abcd
2887+ spring.security.oauth2.client.registration.my-client.client-secret=password
2888+ spring.security.oauth2.client.registration.my-client.provider=google
2889+
2890+ spring.security.oauth2.client.registration.google.client-id=abcd
2891+ spring.security.oauth2.client.registration.google.client-secret=password
2892+ ----
28782893
28792894
28802895
0 commit comments