View and create OAuth 2.0 configurations
Retrieve and configure OAuth 2.0 settings within your cluster using this API. Utilize the POST request to establish a new OAuth 2.0 configuration when none exists.
Overview
This API is used to retrieve and configure relevant information pertaining to the OAuth 2.0 configuration in the cluster. The POST request creates the OAuth 2.0 configuration if there is none present. Various responses are shown in the examples below.
Examples
Retrieving the OAuth 2.0 configuration in the cluster
The following output shows the OAuth 2.0 configuration in the cluster.
# The API:
/api/security/authentication/cluster/oauth2/clients
# The call:
curl -X GET "https://<mgmt-ip>/api/security/authentication/cluster/oauth2/clients" -H "accept: application/hal+json"
# The response:
{
"records": [
{
"name": "auth0"
}
],
"num_records": 1
}
Creating the OAuth 2.0 configuration
The following output shows how to create the OAuth 2.0 configuration in the cluster.
= The API:
/api/security/authentication/cluster/oauth2/clients
= The call:
curl -X POST "https://+++<mgmt-ip>+++/api/security/authentication/cluster/oauth2/clients?return_records=true" -H "accept: application/hal+json" -d '{ "name": "name", "application": "http", "issuer": "https://examplelab.customer.com", "audience": "aud", "client_id": "client_id", "client_secret": "client_secret", "introspection": {"endpoint_uri": "https://examplelab.customer.com/server/endpoint", "interval": "PT1H" }, "remote_user_claim": "user_claim", "outgoing_proxy": "https://johndoe:somesecret@proxy.example.com:8080", "use_local_roles_if_present": false, "use_mutual_tls": "required" }'+++</mgmt-ip>+++
= The response:
{
"job": {
"uuid": "e45b123b-c228-11e8-aa20-0050568e36bb",
"_links": {
"self": {
"href": "/api/cluster/jobs/e45b123b-c228-11e8-aa20-0050568e36bb"
}
}
}
}
'''