Authenticate via a PKI certificate.
注解
This module is Experimental and should be used with caution
Provides an authenticate function that will allow the caller to authenticate a user via their public cert against a pre-defined Certificate Authority.
TODO: Add a 'ca_dir' option to configure a directory of CA files, a la Apache.
depends: |
|
---|
salt.auth.pki.
auth
(username, password, **kwargs)¶Returns True if the given user cert (password is the cert contents) was issued by the CA and if cert's Common Name is equal to username.
Returns False otherwise.
username
: we need it to run the auth function from CLI/API;password
: contents of user certificate (pem-encoded user public key);Configure the CA cert in the master config file:
external_auth:
pki:
ca_file: /etc/pki/tls/ca_certs/trusted-ca.crt
your_user:
- .*