public class CertificateAuthenticator extends Object implements Authenticator, SecurityCredentialsProvider, LifecycleAware
Applies to subjects that connect through the client connector or the REST interface, such as thin clients, JDBC
and ODBC. Their certificate is matched against the predicates of setPermissions(Map) and the permission
set of the first matching predicate is granted.
Node subjects are never matched against a certificate. While setAlwaysAcceptServerNodes(boolean) is
true, which is the default, every joining node is accepted and granted all permissions.
Set that flag to false to decline node subjects. This authenticator then has to be combined through a
CompositeAuthenticator with one that authenticates nodes, such as JaasAuthenticator.
| Constructor and Description |
|---|
CertificateAuthenticator() |
| Modifier and Type | Method and Description |
|---|---|
SecuritySubject |
authenticate(AuthenticationContext authCtx)
Authenticates a given subject (either node or remote client).
|
SecurityCredentials |
credentials()
Unless
setAlwaysAcceptServerNodes(boolean) is set to false, returns empty SecurityCredentials
to be used as credentials of local node. |
boolean |
isGlobalNodeAuthentication()
Flag indicating whether node authentication should be run on coordinator only or on all nodes
in current topology.
|
void |
setAlwaysAcceptServerNodes(boolean alwaysAcceptServerNodes)
Sets whether every remote node is accepted without any check,
true by default. |
void |
setPermissions(Map<? extends IgnitePredicate<Certificate[]>,SecurityPermissionSet> permsMap)
Sets mapping of certificate predicates to permissions.
|
<P extends IgnitePredicate<Certificate[]>> |
setPermissionsJson(Map<P,String> permsMapJson)
Sets mapping of certificate predicates to permissions.
|
void |
start()
Starts grid component, called on grid start.
|
void |
stop()
Stops grid component, called on grid shutdown.
|
boolean |
supported(SecuritySubjectType subjType)
Checks if given subject is supported by this authenticator.
|
String |
toString() |
public void setPermissions(Map<? extends IgnitePredicate<Certificate[]>,SecurityPermissionSet> permsMap)
LinkedHashMap to make sure authorization results are consistent.permsMap - Map of certificate matchers to permissions.public <P extends IgnitePredicate<Certificate[]>> void setPermissionsJson(Map<P,String> permsMapJson) throws IgniteCheckedException
LinkedHashMap to make sure authorization results are consistent.
Permissions are passed in JSON form, please refer to AuthenticationAclBasicProvider for details.permsMapJson - Map of certificate matchers to permissions in JSON format.IgniteCheckedExceptionpublic void setAlwaysAcceptServerNodes(boolean alwaysAcceptServerNodes)
true by default.
Set to false to decline node subjects and combine this authenticator with one that handles them,
such as JaasAuthenticator.
alwaysAcceptServerNodes - Whether to accept every remote node.public void start()
start in interface LifecycleAwarepublic void stop()
stop in interface LifecycleAwarepublic boolean supported(SecuritySubjectType subjType)
supported in interface AuthenticatorsubjType - Subject type.True if subject type is supported, false otherwise.public SecuritySubject authenticate(AuthenticationContext authCtx) throws IgniteCheckedException
authenticate in interface AuthenticatorauthCtx - Authentication context. Contains all necessary information required to authenticate
the subject.null if authentication did not pass.IgniteCheckedException - If authentication resulted in system error.
Note that bad credentials should not cause this exception.public boolean isGlobalNodeAuthentication()
isGlobalNodeAuthentication in interface AuthenticatorTrue if all nodes in topology should authenticate joining node. In this case security
permissions will be validated to be the same on all nodes. In case if permissions differ, node will
not be able to join the topology. If this method returns false, only coordinator node will
authenticate joining node.public SecurityCredentials credentials()
setAlwaysAcceptServerNodes(boolean) is set to false, returns empty SecurityCredentials
to be used as credentials of local node.credentials in interface SecurityCredentialsProvidernull.
GridGain In-Memory Computing Platform : ver. 8.9.37 Release Date : August 25 2026