Authentication providers API

LICENSED TIER: Unlock authentication providers in Sensu Go with a Sensu license. To activate your license, see the getting started guide.

The /authproviders API endpoints

/authproviders (GET)

The /authproviders API endpoint provides HTTP GET access to authentication provider configuration in Sensu.

API Specification

/authproviders (GET)
description Returns the list of active authentication providers.
example url http://hostname:8080/api/enterprise/authentication/v2/authproviders
pagination This endpoint supports pagination using the limit and continue query parameters. See the API overview for details.
response type Array
response codes
  • Success: 200 (OK)
  • Error: 500 (Internal Server Error)
output
[
  {
    "Type": "ldap",
    "api_version": "authentication/v2",
    "spec": {
      "servers": [
        {
          "host": "127.0.0.1",
          "binding": {
            "user_dn": "cn=binder,dc=acme,dc=org",
            "password": "P@ssw0rd!"
          },
          "group_search": {
            "base_dn": "dc=acme,dc=org"
          },
          "user_search": {
            "base_dn": "dc=acme,dc=org"
          }
        }
      ]
    },
    "metadata": {
      "name": "openldap"
    }
  }
]

The /authproviders/:name API endpoints

/authproviders/:name (GET)

The /authproviders/:name API endpoint provides HTTP GET access to authentication provider configuration for a specific :name.

API Specification

/authproviders/:name (GET)
description Returns the configuration for an authentication provider given the configured provider name.
example url http://hostname:8080/api/enterprise/authentication/v2/authproviders/openldap
response type Map
response codes
  • Success: 200 (OK)
  • Missing: 404 (Not Found)
  • Error: 500 (Internal Server Error)
output
{
  "Type": "ldap",
  "api_version": "authentication/v2",
  "spec": {
    "servers": [
      {
        "host": "127.0.0.1",
        "binding": {
          "user_dn": "cn=binder,dc=acme,dc=org",
          "password": "P@ssw0rd!"
        },
        "group_search": {
          "base_dn": "dc=acme,dc=org"
        },
        "user_search": {
          "base_dn": "dc=acme,dc=org"
        }
      }
    ]
  },
  "metadata": {
    "name": "openldap"
  }
}

/authproviders/:name (PUT)

The /authproviders/:name API endpoint provides HTTP PUT access to create or update an authentication provider configuration given :name.

API Specification

/authproviders/:name (PUT)
description Create or update an authentication provider configuration given the name. See the authentication guide for more information about supported providers.
example url http://hostname:8080/api/enterprise/authentication/v2/authproviders/openldap
payload
{
  "Type": "ldap",
  "api_version": "authentication/v2",
  "spec": {
    "servers": [
      {
        "host": "127.0.0.1",
        "binding": {
          "user_dn": "cn=binder,dc=acme,dc=org",
          "password": "P@ssw0rd!"
        },
        "group_search": {
          "base_dn": "dc=acme,dc=org"
        },
        "user_search": {
          "base_dn": "dc=acme,dc=org"
        }
      }
    ]
  },
  "metadata": {
    "name": "openldap"
  }
}
payload parameters All attributes shown in the example payload are required. For more information about configuring authentication providers, see the authentication guide.
response codes
  • Success: 200 (OK)
  • Malformed: 400 (Bad Request)
  • Error: 500 (Internal Server Error)

/authproviders/:name (DELETE)

The /authproviders/:name API endpoint provides HTTP DELETE access to delete an authentication provider configuration from Sensu given the :name.

EXAMPLE

The following example shows a request to delete the configuration for the authentication provider openldap, resulting in a successful HTTP 204 No Content response.

curl -X DELETE \
-H "Authorization: Bearer $SENSU_TOKEN" \
http://127.0.0.1:8080/api/core/v2/namespaces/default/authproviders/openldap

HTTP/1.1 204 No Content

API Specification

/authproviders/:name (DELETE)
description Deletes an authentication provide configuration from Sensu given the name.
example url http://hostname:8080/api/enterprise/authentication/v2/authproviders/openldap
response codes
  • Success: 204 (No Content)
  • Missing: 404 (Not Found)
  • Error: 500 (Internal Server Error)