Merge pull request #10615 from vpavic:improve-oauth-docs

* pr/10615:
  Use properties in Security OAuth2 Client doc config example
  Fix Security OAuth2 Client documentation
pull/10609/merge
Stephane Nicoll 7 years ago
commit d974a74586

@ -2836,7 +2836,7 @@ explicitly configure the paths that you do want to override.
[[boot-features-security-oauth2]] [[boot-features-security-oauth2]]
=== OAuth2 === OAuth2
=== Client ==== Client
If you have `spring-security-oauth2-client` on your classpath you can take advantage of If you have `spring-security-oauth2-client` on your classpath you can take advantage of
some auto-configuration to make it easy to set up an OAuth2 Client. This configuration some auto-configuration to make it easy to set up an OAuth2 Client. This configuration
makes use of the properties under `OAuth2ClientProperties`. makes use of the properties under `OAuth2ClientProperties`.
@ -2844,38 +2844,31 @@ makes use of the properties under `OAuth2ClientProperties`.
You can register multiple OAuth2 clients and providers under the You can register multiple OAuth2 clients and providers under the
`spring.security.oauth2.client` prefix. For example: `spring.security.oauth2.client` prefix. For example:
[source,yaml,indent=0] [source,properties,indent=0]
---- ----
spring: spring.security.oauth2.client.registration.my-client-1.client-id:=abcd
security: spring.security.oauth2.client.registration.my-client-1.client-secret=password
oauth2: spring.security.oauth2.client.registration.my-client-1.client-name=Client for user scope
client: spring.security.oauth2.client.registration.my-client-1.provider=my-oauth-provider
registration: spring.security.oauth2.client.registration.my-client-1.scope=user
my-client-1: spring.security.oauth2.client.registration.my-client-1.redirect-uri=http://my-redirect-uri.com
client-id: abcd spring.security.oauth2.client.registration.my-client-1.client-authentication-method=basic
client-secret: password spring.security.oauth2.client.registration.my-client-1.authorization-grant-type=authorization_code
client-name: Client for user scope
provider: my-oauth-provider spring.security.oauth2.client.registration.my-client-2.client-id=abcd
scope: user spring.security.oauth2.client.registration.my-client-2.client-secret=password
redirect-uri: http://my-redirect-uri.com spring.security.oauth2.client.registration.my-client-2.client-name=Client for email scope
authentication-method: basic spring.security.oauth2.client.registration.my-client-2.provider=my-oauth-provider
authorization-grant-type: authorization_code spring.security.oauth2.client.registration.my-client-2.scope=email
my-client2: spring.security.oauth2.client.registration.my-client-2.redirect-uri=http://my-redirect-uri.com
client-id: abcd spring.security.oauth2.client.registration.my-client-2.client-authentication-method=basic
client-secret: password spring.security.oauth2.client.registration.my-client-2.authorization-grant-type=authorization_code
client-name: Client for email scope
provider: my-oauth-provider spring.security.oauth2.client.provider.my-oauth-provider.authorization-uri=http://my-auth-server/oauth/authorize
scope: email spring.security.oauth2.client.provider.my-oauth-provider.token-uri=http://my-auth-server/oauth/token
redirect-uri: http://my-redirect-uri.com spring.security.oauth2.client.provider.my-oauth-provider.user-info-uri=http://my-auth-server/userinfo
authentication-method: basic spring.security.oauth2.client.provider.my-oauth-provider.jwk-set-uri=http://my-auth-server/token_keys
authorization-grant-type: authorization_code spring.security.oauth2.client.provider.my-oauth-provider.user-name-attribute=name
provider:
my-oauth-provider:
authorization-uri: http://my-auth-server/oauth/authorize
token-uri: http://my-auth-server/oauth/token
user-info-uri: http://my-auth-server/userinfo
jwk-set-uri: http://my-auth-server/token_keys
user-name-attribute: name
---- ----
NOTE: For common OAuth2 and OpenID providers such as Google, Github, Facebook and Okta, NOTE: For common OAuth2 and OpenID providers such as Google, Github, Facebook and Okta,

Loading…
Cancel
Save