Add example of OAuth2 configuration.

This commit is contained in:
Scott Frederick
2018-03-26 15:57:33 -05:00
parent db74d0be15
commit 63b5b70a24

View File

@@ -28,7 +28,7 @@ badges:
{% capture billboard_description %}
Spring CredHub provides client-side support for storing, retrieving, and deleting credentials from a [CredHub](https://github.com/cloudfoundry-incubator/credhub) server running in a [Cloud Foundry](https://www.cloudfoundry.org/) platform.
Spring CredHub provides client-side support for storing, retrieving, and deleting credentials from a [CredHub](https://docs.cloudfoundry.org/credhub/) server running in a [Cloud Foundry](https://www.cloudfoundry.org/) platform.
{% endcapture %}
@@ -113,7 +113,26 @@ public class MyApp {
CredHub supports two authentication methods: mutual TLS and OAuth2.
Spring CredHub currently supports mutual TLS authentication with applications deployed to Cloud Foundry using the Container Security Provider feature of the Java Buildpack. Applications using Spring CredHub should be deployed to Cloud Foundry using Java Buildpack [3.17](https://github.com/cloudfoundry/java-buildpack/releases/tag/v3.17) or greater, or [4.1](https://github.com/cloudfoundry/java-buildpack/releases/tag/v4.1) or greater.
### Mutual TLS
Mutual TLS is the default authentication scheme used when no other authentication configuration is provided.
Mutual TLS support on Cloud Foundry requires the the Container Security Provider feature of the Java Buildpack. Applications using Spring CredHub should be deployed to Cloud Foundry using Java Buildpack [3.17](https://github.com/cloudfoundry/java-buildpack/releases/tag/v3.17) or greater, or [4.1](https://github.com/cloudfoundry/java-buildpack/releases/tag/v4.1) or greater.
### OAuth2
The following configuration can be provided in a Spring Boot application using Spring CredHub (e.g. in `application.yml`) to enable OAuth2 authentication to a CredHub server.
```yaml
spring:
credhub:
oauth2:
client-id: [OAuth2 client ID]
client-secret: [OAuth2 client secret]
access-token-uri: [OAuth2 token server endpoint]
```
{% endcapture %}