For the complete documentation index, see llms.txt. This page is also available as Markdown.

Authentication

Configure authentication for a GridGain cluster: Ignite passcode, GridGain passcode, certificate, JAAS, composite, Control Center OpenID, and LDAP/AD authentication.

GridGain ships with a simple password-based authentication mechanism that is limited to thin client, JDBC, and ODBC connections.

GridGain Enterprise and Ultimate editions provide a more advanced Authentication and Authorization feature, which can be configured for cluster nodes as well as thin clients/JDBC/ODBC connections. For example, you can use different accounts for server nodes and client nodes and configure different sets of permissions for different clients.

Ignite Authentication

Ignite Authentication is available in all GridGain editions. However, if you use GridGain Enterprise or Ultimate Edition, we recommend enabling the GridGain Authentication feature.

You can enable Ignite Authentication by setting the authenticationEnabled property to true in the node's configuration. This type of authentication requires persistent storage be enabled for at least one data region.

<bean class="org.apache.ignite.configuration.IgniteConfiguration">
    <property name="dataStorageConfiguration">
        <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
            <property name="defaultDataRegionConfiguration">
                <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
                    <property name="persistenceEnabled" value="true"/>
                </bean>
            </property>
        </bean>
    </property>

   <property name="authenticationEnabled" value="true"/> 

</bean>
IgniteConfiguration cfg = new IgniteConfiguration();

// Ignite persistence configuration.
DataStorageConfiguration storageCfg = new DataStorageConfiguration();

// Enabling the persistence.
storageCfg.getDefaultDataRegionConfiguration().setPersistenceEnabled(true);

// Applying settings.
cfg.setDataStorageConfiguration(storageCfg);

// Enable authentication
cfg.setAuthenticationEnabled(true);

Ignite ignite = Ignition.start(cfg);

Not supported.

The first node that you start must have authentication enabled. Upon start-up, GridGain creates a user account with the name "ignite" and password "ignite". This account is meant to be used to create other user accounts for your needs. Then simply delete the "ignite" account.

You can manage users using the following SQL commands:

GridGain Authentication

GridGain Authentication allows you to control access to the cluster for every entity, including server and client nodes, thin clients, JDBC/ODBC and REST API clients. The feature also enables you to manage what operations the entities are allowed to perform (authorization).

How to enable authentication:

  1. The first step is to configure an authenticator that verifies the credentials of any entity trying to connect to the cluster (such as server or client nodes, thin clients, etc.).

    GridGain supports several ways to configure an authenticator:

  2. Specify the username and password (of one of the existing users) in every node that connects to the cluster. This is done by using a security credentials provider.

  3. All applications that use thin clients, JDBC/ODBC, or REST API must provide user credentials as well.

Note that all server nodes must have the same authenticator configuration. GridGain verifies that all nodes use the same authenticator on the node start-up.

The following two sections explain how to configure the authenticator.

Passcode Authentication

The simplest way to configure authentication is to define the list of users in the node configuration. This approach consists in creating an access-control list with a set of credentials and the permissions attached to them.

In the following example, we define two users: 'server' and 'client'. The 'server' user is allowed to execute any operation. The 'client' user can only execute cache read operations. All server nodes use the 'server' user credentials, and all client nodes use the credentials of the 'client' user. Refer to the Authorization and Permissions for the full list of supported permissions.

Not supported.

Here is the configuration of a client node:

Not supported.

Not supported.

Client Certificate Authentication

If SSL is enabled, you can grant permissions based on fields of the certificate provided by the clients. When a client connects to the cluster, its certificate is validated against a predefined list of predicates. Each predicate is associated with a list of permissions. If a predicate matches the client certificate, the client is granted the associated permissions. Predicates are defined in the form of regular expressions. If the client's certificate does not match any predicate, the client is rejected.

For example, you can define a list of permissions that are granted only if the client's certificate subject contains "O=CustomerOrganization".

Certificate-based authentication is provided by the CertificateAuthenticator class.

In the following example, we configure SSL in the cluster and enable certificate-based client authentication. Please refer to the Authorization and Permissions for the full list of supported permissions.

Not supported.

Not supported.

Client configuration only requires enabling SSL with an appropriate certificate:

JAAS Authentication

The JAAS authenticator uses Java Authentication and Authorization Service login modules for user authentication. The configuration of the login module is specified via the -Djava.security.auth.login.config=/my/path/jaas.config system property. GridGain reads the entry named GridJaasLoginContext from that file. Set the loginContextName property of the authenticator to read a different entry. Refer to the JAAS Reference Guide for details.

To enable JAAS authentication, use the following configuration example:

Not supported.

Not supported.

securityCredentialsProvider is a server property that enables the authentication server to provide credentials to other servers.

You can use JAAS authenticator to configure LDAP and AD Authentication.

Composite Authentication

The composite authenticator holds a list of other authenticators, including custom authenticators. Every subject is offered to each authenticator in list order. The first authenticator that accepts the subject type and authenticates the subject decides its permissions.

The following example authenticates thin clients by certificate and server nodes join by credentials. alwaysAcceptServerNodes is false, which makes the certificate authenticator decline node subjects and leaves them to JAAS.

Not supported.

Not supported.

Client configuration in these scenarios should be configured for the authenticator you intend to use for the specific client.

Control Center OpenID Authentication

This authenticator is designed to work with Control Center and is part of Control Center Agent optional module.

The OpenID Authenticator allows users who logged in to Control Center via OpenID Connect to work with the cluster under the same user.

The specific OpenID configuration required depends on the OpenID provider.

OpenID Authentication is only used by Control Center to work with the cluster. A different authentication method must also be configured for managing authentication on the GridGain cluster.

The authenticator reads the user's role from a claim of the access token and maps that role to a set of permissions. It collects the claims in two ways, which you can use separately or together:

  • By sending a UserInfo request to the identity provider. The access token is sent as a bearer token in the Authorization header, and the provider returns the claims about the user.

  • By validating the access token locally as a signed JWT. The signing keys are downloaded from the JWK set endpoint of the provider and cached, so the cluster does not call the provider on every authentication.

Validate the token locally when your identity provider cannot add a custom role claim to the UserInfo response. For example, Microsoft Entra ID exposes Microsoft Graph as its only UserInfo endpoint and does not let you customize the response, so a custom claim reaches the access token but never the UserInfo response.

If you configure both sources, the token is validated against the JWK set first, and then the claims from the UserInfo response are applied on top of the token claims.

If the role claim holds a list of roles, the first role that has a permission mapping is used. To give a user a different role in a specific cluster, add a <claim-name>-<cluster-id> claim, for example gg-role-b70bad57-6a6e-4e4e-9d10-1d1f2f4c04a9. It takes precedence over the <claim-name> claim.

Set the same endpoints, claim name, and permission mapping on every server node. Otherwise, the nodes do not start.

OpenIdAuthenticator Properties

OpenIdAuthenticator supports the following properties:

Property
Description
Default

userInfoUrl

The UserInfo endpoint that returns the verified identity claims for the Control Center user's request. Set at least one of userInfoUrl, jwkSetUrl, or wellKnownUrl.

N/A

jwkSetUrl

The JWK set endpoint that publishes the keys used to validate the Control Center user's request. Set at least one of userInfoUrl, jwkSetUrl, or wellKnownUrl.

N/A

wellKnownUrl

The URL of the OpenID Connect provider metadata to take the JWK set endpoint and the expected token issuer. Set at least one of userInfoUrl, jwkSetUrl, or wellKnownUrl.

N/A

issuer

The expected token issuer. A token with a different iss claim is rejected. Set it only together with jwkSetUrl.

N/A

audience

The expected token audience. A token that is not issued for this audience is rejected. Applies to local validation only.

N/A

jwsAlgorithms

The accepted token signature algorithms. A token signed with any other algorithm is rejected. Applies to local validation only.

RS256

jwkSetTimeout

The connect and read timeout of the JWK set and provider metadata requests, in milliseconds. 0 means no timeout.

5000

claimName

The name of the claim that holds the role.

gg-role

permissionsJson

The mapping of a role name to permissions, in JSON form. This property is mandatory. Refer to the Authorization and Permissions for the full list of supported permissions.

N/A

Getting the Role from the UserInfo Endpoint

The example below sets up the cluster for working with PingOne OpenID Connect provider with gg-role set to claimName:

Not supported.

Not supported.

Validating Control Center user's requests by claim in access token

In the example below, the cluster validates the access token as a signed JWT instead of sending a UserInfo request. The JWK set endpoint and the expected issuer come from the provider metadata, and a token is accepted only if it is issued for the gridgain-cluster audience. Use this authenticator in place of the OpenIdAuthenticator bean of the previous example:

Not supported.

Not supported.

To point the cluster at the JWK set endpoint directly, set jwkSetUrl instead of wellKnownUrl. In that case the iss claim of the token is not verified:

The signing keys are loaded on demand and cached, and they are kept for a while if the JWK set endpoint becomes unavailable, so a short outage of the identity provider does not block authentication.

Local validation checks the token signature, the expiration time, the audience when it is set, and the issuer. The token must also carry the sub and exp claims.

Because the cluster does not call the identity provider on every authentication, a revoked token or a withdrawn role takes effect only after the token expires.

LDAP and AD Authentication

Permissions can be assigned from permission strings in LDAP or AD records, or by looking up a role defined in the server configuration. JAAS uses the authzIdentity configuration value as a query to look up the identity to assign an authenticated user. This identity may be interpreted as a role name or as a permission string. GridGain first searches the map in the JaasBasicPermissionsProvider constructor arguments for a key, and then assigns the permissions associated with that map key. If the role map lookup fails, GridGain defaults to using the authzIdentity result as a permission string for the authenticated user.

Permissions Granted Directly from LDAP or AD

To enable LDAP authentication, follow this procedure:

  1. Configure the JAAS authenticator as explained in JAAS Authentication section.

  2. Create a config file for the LdapLoginModule. Below is an example of such a file:

    Here <ATTR_NAME_OF_GRIDGAIN_PERMISSIONS> is the attribute name of the user’s LDAP entry that contains GridGain permissions in a specific format. The following example defines a set of permissions for executing tasks and operations on caches. See Authorization and Permissions for the full list of available permissions.

  3. Start all server nodes with the following system property:

When started with this configuration file, the node loads the list of users and permissions from the provided LDAP server.

Role-based Authentication with Active Directory

It is often required to authenticate GridGain users based on their AD role (i.e., the authentication/authorization group they belong to). Typical requirements for a GridGain cluster running within an Active Directory domain would be as follows:

  • Every node or client application has to authenticate itself with the domain providing correct credentials of one of the user accounts.

  • Access to the cluster has to be restricted based on groups; i.e., a user can be granted a certain set of permissions if and only if that user is a member of a specific group.

Active Directory Settings

  1. Define requirements and create Active Directory groups and users to be used for access control. For example:

    • Read-only users - can read from any cache in the cluster, but can't do updates

    • Read-write users - can both read and update data in caches

    • Superusers - have full access to all cluster functions.

  2. Assign users to the groups.

On the cluster side, you need to separately configure JAAS and GridGain. The JAAS part defines how you interact with Active Directory. The GridGain part provides the actual permissions for the different groups and ties everything together.

Cluster Configuration - JAAS

GridGain assumes that every user has a special attribute in LDAP to store GridGain permissions as a JSON string (name of the attribute is provided to JAAS via the authzIdentity parameter). This does not work with the typical Active Directory structure. You want to assign permissions based on groups and roles rather than store them directly in LDAP.

Specify the userFilter parameter to search for the user entry that is included in a particular group. Filter conditions like memberOf=GROUP_NAME mimic the "contains" operation and return true if one of the items in the memberOf collection equals the provided name.

Apply the above approach to every group one-by-one. In JAAS terms, you create multiple login modules, one for each group. Here is the full configuration:

The above defines four LDAP login modules, each marked as SUFFICIENT. This means that if at least one module is successful, the user is authenticated. Two common parameters are self-explanatory — userProvider and authIdentity. The userFilter and authzIdentity parameters are unique for every module, and are used to identify which group the user is part of (if any).

For every module, JAAS will go through the following process:

  1. Connect to the LDAP server and authenticate with the provided username and password.

  2. Use the userFilter search string to look for the user entry based on the username and the group name the current module is responsible for.

  3. If the above user entry exists (i.e., the user is included in the group), create a principal with the name provided in the authzIdentity parameter, and stop the process with success.

  4. If the above user entry can't be found, move on to the next module (or fail if there are no modules left).

As a result, a successfully authenticated user is created with a principal holding the group name. This name is then passed to GridGain's permissions provider.

If you want to assign a user to multiple AD groups, convert all login modules in the above configuration from SUFFICIENT to OPTIONAL. This instructs JAAS to not stop after the first successful module, but rather continue going through the list and collect all authorization identities applicable to the user. GridGain then merges all the relevant permissions together and provides the expected user access behavior. This option is available starting from GridGain 8.7.8.

Cluster Configuration - GridGain

In the GridGain configuration, enable JaasAuthenticator and use the permission provider to specify the mapping between the possible group names and the corresponding permissions. For the latter, use JaasBasicPermissionsProvider, which GridGain includes out-of-the-box.

For the four groups created earlier, the XML configuration looks like this:

In the above configuration, you set permissions for every group. For example, users included in GG_CacheReadOnlyUsers will have access to all caches, but will only be able to read the data.

Example

A basic example that demonstrates role/group-based authentication for AD users.

GridGain server node configuration (server.xml):

GridGain client node configuration (client.xml):

JAAS configuration (jaas.config):

The server application (Server.java):

The above application uses a special user account called GG_ServerAccount, which is a member of the GG_SuperUsers group. This means that it has full access to all APIs and cluster functions. This is a general practice: although server nodes have to authenticate in the same way as clients, there is typically no need to put restrictions on them.

The client application (Client.java):

The above application authenticates with the read-only account, which is created at the very beginning. Therefore, this application is only able to read the data, but not update it. Indeed, when trying to execute a cache PUT operation, it fails with an authorization error:

In addition, the server is configured to print out a list of currently authenticated users every time a new node joins the topology. This way, you can confirm that everything is configured correctly. Here is the output after both server and client nodes are up:

The example above results in a user running under the server account with all the possible permissions — that is the server node. The second user is the client, which has the CACHE_READ permission only.

Supplying Credentials in Clients

When authentication is configured in the cluster, all client applications must provide user credentials. Refer to the following pages for the information about specific clients:

This page is: Copyright © 2026 MariaDB. All rights reserved.

spinner

Last updated

Was this helpful?