← Back to plugin index

Certificate Authenticator

Description
Authenticator used to perform authentication based on X509 certificates.

Warning 1: This authenticator assumes that some external process can guarantee that the certificate belongs to the authenticating entity. This is typically done by challenging the entity to sign something with the corresponding private key. This is, for example, the case in an SSL handshake involving client certificate verification.

Warning 2: This authenticator does not check whether the certificate was signed by a trusted entity. This must be done prior to calling this authenticator, typically during an SSL handshake.

The credentials passed to this authenticator must be of type CertificateCredential or UserCredential.
If the credential contains a username (subtype of UserCredential) the user name is stored in the authentication session for usage after successful verification of the certificate.
If the credential contains a username but no certificate (type UserCredential but not of subtype CertificateCredential), this plugin responds with CERTIFICATE_REQUIRED. This makes it suitable for usage with the MetaAuthenticator plugin.

What checks are done on the certificate and how the user name and granted roles (and possibly other data) are determined is specified by the configuration.

There are two different (and mutual exclusive) ways how this plugin determines the username given the client certificate:
(1) Extract username from client certificate. In this case the username potentially passed as credential is ignored. Look at configuration property user-attribute for this case.
(2) Take user name from the credential. In this case, the credential must contain a username.
Independent of the way the username has been determined, a credential persister can be used to verify that the client certificate really belongs to the username. See property credential-persister for details. If the client certificate does not match the data stored under the determined username, the authentication response AuthenticationFailedCertificate.CERTIFICATE_DOES_NOT_MATCH_USER is returned.

The plugin writes the canonical class name description of this plugin to the context data container. The class name is stored under the key authPluginClassName . A short description of this authentication method is stored under the key authMethodShortDesc . This information may be used by callers.

Type name
CertificateAuthenticator
Class
com.airlock.iam.core.misc.impl.authen.CertificateAuthenticator
May be used by
License-Tags
ClientCertificate
Properties
User Attribute (userAttribute)
Description
Defines how the user's username (or other piece of data used to look up the username) is to be extracted from the certificate. If this property is not defined, the username is not extracted from the certificate but expected to be part of the credential passed to this plugin (see plugin description).

If a credential persister is configured (see below), the extracted user name is used to look up the credential bean. The bean can be used for further checks.
Note: This can be used to find a user mapped to the certificate (e.g. the CN of the certificate is stored with the username in the persistence layer). To do so, configure the credential persister accordingly to look up the credential data given the value defined by this property(which does not necessarily have to be the real username). Then use the credential-bean-username property below to read the real username from the credential bean.
Note: This property has precedence over the username in the credential object. Thus, if this property is defined, any user information passed as credential is ignored.

Usually the username is part of the DN (distinguished name) of the certified subject.
This attribute specifies the attribute name of the username in the DN. Example: The value "cn" will extract the common name from the DN and use this as username.

The following values are treated especially:

  • "dn": use this value to use the whole distinguished name as username.
  • "altSubjectName": use this value to use the alternative subject name as username.
See also configuration property "strip-domain-from-username".

If this property is not defined, the plugin takes the username from the credential.

Look at property credential-persister to see how to validate that the user is registered with for this client certificate.

Attributes
String
Optional
Suggested values
cn, sAMAccountName, dn, altSubjectName
Strip Domain From Username (stripDomainFromUsername)
Description
If this property is set to TRUE and the username (see configuration property "user-attribute") has a domain part (as in "john.doe@domain.com"), the domain part is stripped off (resulting in "john.doe").
This property is ignored if the configuration property "user-attribute" is not defined or set to "dn".
Attributes
Boolean
Optional
Default value
false
Credential Persister (credentialPersister)
Description
Class name of the credential persister used to validate that the client certificate really belongs to the user identifier by the username determined by this plugin (either taken from the credential or from the client certificate).

If this property is defined, the plugin is used to look up a credential bean using the determined username (or other id determined by this plugin). Then a check is performed whether the certificate really belongs to the user. The check is defined by the separate configuration property "matchPolicy".

How this plugin reacts if no credential record can be found is specified by the separate property "treat-no-credential-data-as-not-assigned".

Attributes
Plugin-Link
Optional
Assignable plugins
Username Transformation (usernameTransformers)
Description

Username transformers may transform the name a user states in the login-form into the single unique user-id required for the authentication process.

The transformation of a username takes place after extracting the user name from the presented certificate and before the authenticator reads the user from persistency layer. If a username is supplied from a previous authentication step, then no transformation is done here.

Transfomers can be chained, i.e. a first transformer could normalize the original name, where the next transformer looks-up the normalized name in a database for eventual transformation matches.

A transformer can also signal that it already found the final user-id and the chain must stop after him.

Attributes
Plugin-List
Optional
Assignable plugins
Do Not Update User Statistics (doNotUpdateUserStatistics)
Description
If a user persister is configured (see property "user-persister") and this property is set to TRUE, user statistics (failed logins, etc.) are not updated. This is helpful if this authenticator is part of a bigger authentication scheme (e.g. using the MetaAuthenticator plugin).

This property is only relevant if a user persister is configured.

Attributes
Boolean
Optional
Default value
false
Match Policy (matchPolicy)
Description
Defines how this plugin checks whether a certificate belongs to the user or not.

This check is only done if a credential bean has been loaded using the configured credential persister.
The credential data of the credential bean is compared to the certificate depending on the value of this property:

  • "DNs" : The distinguished names (DN) of the certificate subject and the issuer is compared to the string data of the credential bean. The comparison is case-insensitive. The DNs are encoded in the following form for comparison: <issuer-dn>ISSUER-DN</issuer-dn><subject-dn>SUBJECT-DN</subject-dn>
    This is the default value.
  • "subject-DN" : The DN of the certificate subject is compared to the string data of the credential bean. The comparison is case-insensitive. This setting can be combined with the setting "issuer-dn-property"
  • "CN" : The common name (CN) of the certificate subject is compared to the string data of the credential bean. The comparison is case-insensitive. This setting can be combined with the setting "issuer-dn-property"
  • "TBS" : The TBS (to-be-signed) part of the certificate is compared to the string or binary data of the credential bean. If the credential data is binary, the comparison is done byte-wise, if it is a string type credential, the TBS-part is base64-encoded before comparing.
  • "certificate" : The X509 certificate is compared to the string or binary data of the credential bean. If the credential data is binary, the comparison is done byte-wise, if it is a string type credential, the certificate is base64-encoded before comparing.
  • "NONE" : No check is performed.

Note: For backwards-compatibility, the default value of this property is "DNs"!

If a credential record can be found but it contains no credential data, this plugin responds with CREDENTIAL_NOT_ASSIGNED (can for example start a registration process), if credential data can be found but does not match in this check, CERTIFICATE_DOES_NOT_MATCH_USER. How the plugin behaves if no credential record can be found at all is defined property "treat-no-credential-data-as-not-assigned".

Attributes
String
Optional
Default value
DNs
Allowed values
DNs, subject-DN, CN, TBS, certificate, NONE
Issuer Dn Property (issuerDnProperty)
Description
The name of the credential context data property holding the DN (distinguished name) of the issuer of the client certificate.

This setting is only used in conjunction with match policies "CN" and "subject-DN" and requires that a credential persister is configured: In addition to matching the cn or subject dn the issuer DN is also compared to the value stored in the context property (of the credential context container) referenced by this setting.
The comparison is case-insensitive.

Attributes
String
Optional
Example
issuer_dn
Multi Format Dn Comparison (multiFormatDnComparison)
Description
If set to true, comparison of distinguished names (DNs) supports various formats. If set to true, the following DNs are considered to be equal:
  • a=A,b=B,c=C
  • c=C,b=B,a=A (backwards)
  • /a=A/b=B/c=C (slash notation)
  • /c=C/b=B/a=A (slash notation backwards)
  • a=A,b=B,x.y.z=C (where x.y.z is the OID for attribute c)

This affects match policy "subject-DN" and it affects issuer DN comparison if the property "issuer-dn-property" is defined.

Attributes
Boolean
Optional
Default value
false
User Property (userProperty)
Description
Name (key) of a context data property in the credential bean that defines the username to be used.

This property is used in situations where the username cannot be extracted directly from the certificate but it is determined by looking up a credential bean and reading the username from it. If the referenced context data property cannot be found, an AuthenticatorException is thrown.

If this property is defined, it usually makes sense to also set the property "treat-no-credential-data-as-not-assigned" to true.

Attributes
String
Optional
Example
username
Example
uid
Treat No Cred Data As Not Assigned (treatNoCredDataAsNotAssigned)
Description
If this property is set to "TRUE", this plugin responds with CREDENTIAL_NOT_ASSIGNED if no credential bean can be found at all. If it is "FALSE" (which is the default), this plugin responds with USER_NOT_FOUND.

This property exists to make this plugin suitable for situations where the username cannot be extracted directly from the certificate but it is determined by looking up a credential bean and reading the username from it. In this case not finding a credential bean at all usually means that the certificate has not yet been assigned. In the other case - i.e. the username is directly read from the certificate - not finding the credential bean usually means that the user does no more exist.

Attributes
Boolean
Optional
Default value
false
Static Roles (staticRoles)
Description
A comma-separated list of roles (role names, optionally followed by a colon and a role idle timeout in seconds) that are granted to authenticated users. Make sure not to use spaces between the values.
Attributes
String
Optional
Example
role1,role2:300
Example
admin
Example
user:300,employee:600
Certificate Status Checker (certificateStatusChecker)
Description
The certificate status checker plug-in used to check the revocation status of the client certificate. The status checker can for example use a CRL or an OCSP service to do this.

Note: If this optional property is not defined or empty (and no certificate status checker plugins are configured by the property "Cert Status Checkers"), no status check is performed (i.e. all certificates are considered to be non-revoked).

Attributes
Plugin-Link
Optional
Assignable plugins
User Persister (userPersister)
Description
Class name of a user persister used after successful certificate verification and user extraction. The user is loaded from the persister in order to check the "locked" status and update statistics. In one of the following cases, the authentication fails (after successful certificate verification!):
  • User is not found
  • Username is ambiguous
  • User is locked
  • User is not valid
In the case of successful authentication, user data (roles, context data) is loaded and added to the result.
Attributes
Plugin-Link
Optional
Assignable plugins
Max Failed Logins (maxFailedLogins)
Description
The number of failed logins before a user is locked. Set to zero (0) to disable this feature. This feature only works if a user persister is configured.
Attributes
Integer
Optional
Default value
0
Expiring Certificate Warning Days (expiringCertificateWarningDays)
Description
This displays a warning page to the user if the client certificate is about to expire within the configured number of days.
Attributes
Integer
Optional
Additional User Validators (additionalUserValidators)
Description
To validate users beyond the usual tests for being locked or invalid, additional plugins can be added, which e.g. check context data fields. This is only functional if a User Persister is configured.
Attributes
Plugin-List
Optional
Assignable plugins
Check Validity Period (checkValidityPeriod)
Description
If enabled, the validity period of the certificate is checked. If disabled, expired (or not-yet-valid) certificates are also accepted.
Attributes
Boolean
Optional
Default value
true
Certificate Status Checkers (certStatusCheckers)
Description
A list of certificate status checkers used to check the revocation status of the client certificate. If more than one checker is configured, all of them are consulted and the certificate is considered revoked if at least one of them tells so.
Attributes
Plugin-List
Optional
Assignable plugins
YAML Template (with default values)

type: CertificateAuthenticator
id: CertificateAuthenticator-xxxxxx
displayName: 
comment: 
properties:
  additionalUserValidators:
  certStatusCheckers:
  certificateStatusChecker:
  checkValidityPeriod: true
  credentialPersister:
  doNotUpdateUserStatistics: false
  expiringCertificateWarningDays:
  issuerDnProperty:
  matchPolicy: DNs
  maxFailedLogins: 0
  multiFormatDnComparison: false
  staticRoles:
  stripDomainFromUsername: false
  treatNoCredDataAsNotAssigned: false
  userAttribute:
  userPersister:
  userProperty:
  usernameTransformers: