Skip to content

Commit 2180ae6

Browse files
committed
docs: Update client docs to add an example for oauth2 client config
1 parent e1d3156 commit 2180ae6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/modules/ROOT/pages/client.adoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,27 @@ spring:
214214

215215
The `spring.cloud.config.password` and `spring.cloud.config.username` values override anything that is provided in the URI.
216216

217+
If you use OAuth2 security on the server, clients need to know the client ID and client secret.
218+
You can specify the client ID and client secret via separate properties, as shown in the following example:
219+
220+
[source,yaml]
221+
----
222+
223+
spring:
224+
cloud:
225+
config:
226+
uri: https://myconfig.mycompany.com
227+
oauth2:
228+
enabled: true
229+
provider:
230+
token-uri: https://auth.acme.com/oauth/token
231+
registration:
232+
client-id: client-id
233+
client-secret: client-secret
234+
authorization-grant-type: client_credentials
235+
236+
----
237+
217238
If you deploy your apps on Cloud Foundry, the best way to provide the password is through service credentials (such as in the URI, since it does not need to be in a config file).
218239
The following example works locally and for a user-provided service on Cloud Foundry named `configserver`:
219240

0 commit comments

Comments
 (0)