Kerberos auth method (API)
This is the API documentation for the Vault Kerberos auth method plugin. To learn more about the usage and operation, see the Vault Kerberos auth method.
This documentation assumes the Kerberos auth method is mounted at the auth/kerberos
path in Vault. Since it is possible to enable auth methods at any location, please update your API calls accordingly.
The Kerberos auth method validates both Kerberos and LDAP authorization, so both configurations are required.
Configure Vault Kerberos
This endpoint configures the keytab and service account to be used by Vault for verifying inbound SPNEGO tokens.
POST
/auth/kerberos/config
keytab
(string: <required>)
– A base 64 representation of the contents of the Kerberos keytab that will be used for verifying inbound SPNEGO tokens. It should contain an entry matching the service account given. This can be created through the following command:$ base64 vault.keytab > vault.keytab.base64
.service_account
(string: <required>)
– The service account associated with both the keytab entry and an LDAP service account created for Vault. Ex.:"vault_svc"
.remove_instance_name
- Removes any instance names from a Kerberos service principal name when parsing the keytab file. For example when this is set to true, if a keytab has the service principal namefoo/localhost@example.com
, Vault will strip the service principal name to just befoo@example.com
.add_group_aliases
- When set to true, Vault will add any LDAP groups found for the user as group aliases.
Sample request
Sample payload
Read Vault Kerberos
This endpoint retrieves the service account for the Kerberos auth method. The keytab is not returned because it is sensitive information.
GET
/auth/kerberos/config
Sample request
Sample response
Configure Kerberos LDAP
This endpoint configures LDAP in the Kerberos auth method.
POST
/auth/kerberos/config/ldap
Parameters
url
(string: <required>)
– The LDAP server to connect to. Examples:ldap://ldap.myorg.com
,ldaps://ldap.myorg.com:636
. Multiple URLs can be specified with commas, e.g.ldap://ldap.myorg.com,ldap://ldap2.myorg.com
; these will be tried in-order.case_sensitive_names
(bool: false)
– If set, user and group names assigned to policies within the backend will be case sensitive. Otherwise, names will be normalized to lower case. Case will still be preserved when sending the username to the LDAP server at login time; this is only for matching local user/group definitions.starttls
(bool: false)
– If true, issues aStartTLS
command after establishing an unencrypted connection.tls_min_version
(string: tls12)
– Minimum TLS version to use. Accepted values aretls10
,tls11
,tls12
ortls13
.tls_max_version
(string: tls12)
– Maximum TLS version to use. Accepted values aretls10
,tls11
,tls12
ortls13
.insecure_tls
(bool: false)
– If true, skips LDAP server SSL certificate verification - insecure, use with caution!certificate
(string: "")
– CA certificate to use when verifying LDAP server certificate, must be x509 PEM encoded.binddn
(string: "")
– Distinguished name of object to bind when performing user search. Example:cn=vault,ou=Users,dc=example,dc=com
bindpass
(string: "")
– Password to use along withbinddn
when performing user search.userdn
(string: "")
– Base DN under which to perform user search. Example:ou=Users,dc=example,dc=com
userattr
(string: "")
– Attribute on user attribute object matching the username passed when authenticating. Examples:sAMAccountName
,cn
,uid
discoverdn
(bool: false)
– Use anonymous bind to discover the bind DN of a user.deny_null_bind
(bool: true)
– This option prevents users from bypassing authentication when providing an empty password.upndomain
(string: "")
– The userPrincipalDomain used to construct the UPN string for the authenticating user. The constructed UPN will appear as[username]@UPNDomain
. Example:example.com
, which will cause vault to bind asusername@example.com
.groupfilter
(string: "")
– Go template used when constructing the group membership query. The template can access the following context variables: [UserDN
,Username
]. The default is(|(memberUid={{.Username}})(member={{.UserDN}})(uniqueMember={{.UserDN}}))
, which is compatible with several common directory schemas. To support nested group resolution for Active Directory, instead use the following query:(&(objectClass=group)(member:1.2.840.113556.1.4.1941:={{.UserDN}}))
.groupdn
(string: "")
– LDAP search base to use for group membership search. This can be the root containing either groups or users. Example:ou=Groups,dc=example,dc=com
groupattr
(string: "")
– LDAP attribute to follow on objects returned bygroupfilter
in order to enumerate user group membership. Examples: for groupfilter queries returning group objects, use:cn
. For queries returning user objects, use:memberOf
. The default iscn
.
@include 'tokenfields.mdx'
Sample request
Sample payload
Read Kerberos LDAP configuration
This endpoint retrieves the LDAP configuration for the Kerberos auth method.
GET
/auth/kerberos/config/ldap
Sample request
Sample response
List Kerberos LDAP groups
This endpoint returns a list of existing LDAP groups in the Kerberos auth method.
LIST
/auth/kerberos/groups
Sample request
Sample response
Read Kerberos LDAP group
This endpoint returns the policies associated with a Kerberos LDAP group.
GET
/auth/kerberos/groups/:name
Parameters
name
(string: <required>)
– The name of the LDAP group.
Sample request
Sample response
Create/Update Kerberos LDAP group
This endpoint creates or updates LDAP group policies.
POST
/auth/kerberos/groups/:name
Parameters
name
(string: <required>)
– The name of the LDAP group.policies
(string: "")
– Comma-separated list of policies associated to the group.
Sample payload
Sample request
Delete Kerberos LDAP group
This endpoint deletes the LDAP group and policy association.
DELETE
/auth/kerberos/groups/:name
Parameters
name
(string: <required>)
– The name of the LDAP group.
Sample request
Login with Kerberos
This endpoint allows you to log in with a valid Kerberos SPNEGO token. This token is obtained by the client, marshalled, and converted to base 64 using standard encoding.
Example SPNEGO token (newlines added for readability):
POST
/auth/kerberos/login
Sample request
Last updated