← Back to plugin index

Database User Persister

Description
Highly configurable persister using a relational database as user-repository. The database is accessed via JDBC. It fetches the data of a user by directly executing a prepared statement. Making changes persistent is achieved by multiple update statement executions on the user record within a transaction.
This plug-in is very flexible in that most database columns are optional and it allows you to specify extra where clauses and search filters to select the set of users. It also allows to fetch role information from separate tables.

Note: This persister also supports insertion and deletion of users and can be used to iterate over users.

How this plug-in finds a user record

There are two ways how this plugin finds a user record for getting user data, updating user data and deleting user data. The user record is always fetched using a select statement given a primary key and applying the configured filters (additional where clause). The two variants differ in how the primary key is determined:
  1. The primary key for selecting the user record is the username itself. This is by far the most common and most efficient method to obtain user data.
  2. The primary key is determined by a separate query including the username. The query can be configured. This way of selecting the user record is more flexible but results in an additional select statement.
Type name
DatabaseUserPersister
Class
com.airlock.iam.core.misc.impl.persistency.db.DatabaseUserPersister
May be used by
Properties
SQL Data Source (sqlDataSource)
Description
Defines how connections to the database are obtained.
Attributes
Plugin-Link
Mandatory
Assignable plugins
User Table Name (userTableName)
Description
The name of the database table containing the user data.
Attributes
String
Mandatory
Suggested values
medusa_user, medusa_admin
Col User Name (colUserName)
Description
The name of the database column with the username. This column is directly used to search the user unless a separate username-resolve-query (see separate configuration property) is specified.
Attributes
String
Mandatory
Suggested values
username
User Name Resolve Query (userNameResolveQuery)
Description
An SQL query that returns a primary key for the user table given the user name.
Such a query is useful if the username (used on the login page) is not part of the user table.
The query must be such that - given the username - it returns one value that can be used as primary key in the user table. The query must contain one question mark (?) which will be substituted by the username (a string).

If the query returns no records, it results in the user not being found.
If the query returns more than one record, it results in the username being ambiguous.

If this property is not defined, the username itself is used as primary key in the user table (the usual and efficient way).

Note: If this property is defined user insertion by this plugin is no more possible.

Attributes
String
Optional
Example
SELECT u.id FROM user u, person p WHERE p.id = u.person_id and p.contractId = ?
Col Password (colPassword)
Description
The name of the database column with the password hash value (or the password itself).
In general the type of this database column is expected to be BYTE or VARBYTE because password hashes are byte sequences. However, if a password hash function is used that returns a character sequence (for example the password itself) this also works with column type CHAR or VARCHAR.
The plug-in tries to find out automatically whether the password hash is binary or string type by reading a value from the database and looking at the type of the returned object. This may lead to problems with NULL values or "too intelligent" JDBC drivers that implicitly convert HEX- or base64-strings to binary data. The optional property "Is Pwd Hash String Type" can be used to tell the plug-in explicitly what data type this column is.
Attributes
String
Optional
Suggested values
pwd_hash
Is Pwd Hash String Type (isPwdHashStringType)
Description
Flag telling this persister whether the password hash column is a string type column (CHAR, VARCHAR) or whether it is binary (VARBYTE, RAW, BLOB).
The value TRUE indicates that the password hash column is a string type column. The value FALSE indicates that the password hash column is a binary type column.
If this optional property is not defined or empty, the plug-in tries to determine the type of column automatically (see description of property "Col Password").
Attributes
Boolean
Optional
Default value
true
Col Auth Method (colAuthMethod)
Description
The name of the database column that holds the identifier for the authentication method to use for the user, if different authentication methods are supported. The column type is a string type column (CHAR, VARCHAR) and its value may be NULL.
Attributes
String
Optional
Suggested values
auth_method
Default Auth Method (defaultAuthMethod)
Description
The default authentication method value used when inserting new users that have no auth method set. This is only used if an authentication method column is configured.
Attributes
String
Optional
Suggested values
PASSWORD, MATRIX, MTAN, OATH_OTP, CERTIFICATE, CRONTO, EMAILOTP, SECURID, SECOVID
Col Next Auth Method (colNextAuthMethod)
Description
The name of the database column that holds the identifier for the next authentication method to use for the user after a migration. The column type is a string type column (CHAR, VARCHAR) and its value may be NULL.
Attributes
String
Optional
Suggested values
next_auth_method
Default Next Auth Method (defaultNextAuthMethod)
Description
The default next authentication method value used when inserting new users that have no next auth method set. This is only used if a next authentication method column is configured.
Attributes
String
Optional
Suggested values
PASSWORD, MATRIX, MTAN, OATH_OTP, CERTIFICATE, EMAILOTP, SECURID, SECOVID
Col Auth Migration Date (colAuthMigrationDate)
Description
The name of the database column that holds the date until which the migration of the authentication method must be performed. The column type is either DATETIME or TIMESTAMP and its value may be NULL.
Attributes
String
Optional
Suggested values
auth_migration_date
Col User Locked (colUserLocked)
Description
The name of the database column with the flag indicating whether the user is locked or not.
Authenticators usually set a user locked after some number of consecutively failed login attempts. This column type is either CHAR or NUMBER. The value "0" is treated as false, any other value is treated as true.
If this column is not specified, users are not considered locked.
Attributes
String
Optional
Suggested values
locked
Col User Lock Reason (colUserLockReason)
Description
The name of the database column contains the reason why the users is locked.
This can be the hole description of the reason or a key to the string resource.
This column type is either CHAR or VARCHAR.
Attributes
String
Optional
Suggested values
lock_reason
Col User Lock Date (colUserLockDate)
Description
The name of the database column contains the timestamp of the user locking.
The type of this column either DATETIME or TIMESTAMP.
Attributes
String
Optional
Suggested values
lock_date
Col Failed Logins (colFailedLogins)
Description
The name of the database column holding the number of consecutively failed logins. The type of this column is NUMBER.
If this column is not specified, the failed logins are not counted.
Attributes
String
Optional
Suggested values
failed_logins
Col Failed Token Counts (colFailedTokenCounts)
Description
The name of the database column holding the counters for failed attempts on individual authentication tokens. The type of this column is CLOB (or a DB-type equivalent).
If this column is not specified, the failed attempts in the flow-based REST authentication API are not counted.
Attributes
String
Optional
Suggested values
failed_token_counts
Col Failed Logins Before Latest Login (colFailedLoginsBeforeLatestLogin)
Description
The name of the database column holding the number of consecutively failed logins before the latest successful login. The type of this column is NUMBER.
If this column is not specified, the failed logins before the latest successful login are not counted.
Attributes
String
Optional
Suggested values
failed_logins_before
Col Total Logins (colTotalLogins)
Description
The name of the database column holding the total number of successful logins. The type of this column is NUMBER.
If this column is not specified, the successful logins are not counted.
Attributes
String
Optional
Suggested values
total_logins
Col Password Change Forced (colPasswordChangeForced)
Description
The name of the database column with the flag indicating whether the user must be forced to change the password.
This column type is either CHAR or NUMBER. The value "0" is treated as false, any other value is treated as true.
If this column is not specified, no password change is enforced.
Attributes
String
Optional
Suggested values
pwd_chg_enf
Col Password Delivery Date (colPasswordDeliveryDate)
Description
The name of the database column with the date and time of the latest password delivery.
The type of this column either DATETIME or TIMESTAMP. Note that it will work with most data types but depending on the chosen database data type, only the date without the time is stored.
If this column is not specified, the delivery date of the latest password is not provided to callers.
Attributes
String
Optional
Suggested values
pwd_lat_del
Col Other Credentials Delivery Timestamps (colOtherCredentialsDeliveryTimestamps)
Description
Comma-separated list of column names with the delivery dates of other credentials.
The type of every referenced column is either a DATETIME or TIMESTAMP.
This information can be used by components that care about not delivering more than one user credential at the same time.
If this column is not specified, no delivery dates are provided to callers.
Attributes
String
Optional
Example
latest_token_delivery
Example
latest_list_delivery
Example
smart_card_delivery_date
Example
smart_card_delivery_date,pin_delivery_date
Col Password Generation Date (colPasswordGenerationDate)
Description
The name of the database column with the date and time of the latest password generation.
The type of this column either DATETIME or TIMESTAMP.
This information is needed by components in which the generation date of a password and its delivery date is not necessarily the same. This can - for example - be the case when a generated credential is held back because another credential for the same user is delivered at the same time.
If this column is not specified, no password generation date is provided to callers.
Attributes
String
Optional
Example
pwd_lat_gen
Example
latest_password_generation
Example
pwd_gen_date
Col Latest Password Change (colLatestPasswordChange)
Description
The name of the database column with the date and time of the latest password change.
The type of this column either DATETIME or TIMESTAMP.
Attributes
String
Optional
Suggested values
pwd_lat_chg
Col Next Enforced Password Change (colNextEnforcedPasswordChange)
Description
The name of the database column with the date and time of next enforced password change.
The type of this column either DATETIME or TIMESTAMP.
Attributes
String
Optional
Suggested values
pwd_next_chg
Col Password Ordered Flag (colPasswordOrderedFlag)
Description
The name of the database column with the flag indicating whether a new password should be generated for this user.
This column type is either CHAR or NUMBER. The value "0" is treated as false, any other value is treated as true.
If this column is not specified, the password order state is always reported to be false.
Attributes
String
Optional
Suggested values
pwd_order_new
Col Password Ordered User (colPasswordOrderedUser)
Description
The name of the database column with the user by whom a new password was ordered.
This column type is either CHAR or VARCHAR.
If this column is not specified, the password order user is always null.
Attributes
String
Optional
Suggested values
pwd_order_user
Col Password Ordered Date (colPasswordOrderedDate)
Description
The name of the database column with the date of when a new password was ordered.
This column type is either DATETIME or TIMESTAMP.
If this column is not specified, the password order date is always null.
Attributes
String
Optional
Suggested values
pwd_order_date
Col Failed Password Resets (colFailedPasswordResets)
Description

The name of the database column with the number of failed password reset attempts for flow-based password reset. The type of this column is NUMBER

.

Security note: If this column is not specified, failed password reset attempts are not counted, which enables brute-force attacks.

Attributes
String
Optional
Suggested values
pwd_failed_resets
Col Role String (colRoleString)
Description
The name of the database column with a comma-separated list of roles granted to the user after successful authentication.
The type of this column is CHAR or VARCHAR.
Note: There are other ways to determine a user's roles (see other configuration properties). If the roles granted to a user are obtained from other tables (via foreign keys), leave this property empty and use the property roles-query instead.
Attributes
String
Optional
Suggested values
roles
Roles Query (rolesQuery)
Description
As an alternative way to get the roles granted to the authenticated user as described in configuration property Col Role String, this property allows to retrieve the roles based on foreign tables.
This property defines an arbitrary SQL query that returns the roles associated with the user. Note: The statement must be such that the query returns rows consisting of one column only with the granted role!
You may use the string ${userId} to reference the user id of the authenticated user inside the SQL query. The reference may be used once or multiple times.

Example: In the following example, the user table is USER, there is role table ROLE and a table with the user-to-role mappings USER2ROLE:

roles-query="SELECT r.role_name from ROLE r, USER u, USER2ROLE u2r where u.userName = ${userId} AND u.id = u2r.user AND u2r.role = r.id"

Attributes
String
Optional
Example
SELECT r.role_name from ROLE r, USER u, USER2ROLE u2r where u.userName = ${userId} AND u.id = u2r.user AND u2r.role = r.id
Grant Roles (grantRoles)
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 loaded users.
This set of roles is added to the otherwise determined set of roles. Thus, it does not replace otherwise determined roles but can be used in conjunction with other methods.
Attributes
String
Optional
Example
role1,role2:300
Example
admin
Example
user:300,employee:600
Col User Valid (colUserValid)
Description
Name of a database column with a flag indicating whether the user entry is valid or not.
The type of this column is either CHAR or NUMBER. The value "0" is treated as invalid, any other value is treated as valid.
If this column is not specified, all users are considered to be valid.
Attributes
String
Optional
Suggested values
valid
Col User Not Valid After (colUserNotValidAfter)
Description
The name of the database column indicating the point in time after which a user record is considered not valid anymore. The type of this column either DATETIME or TIMESTAMP.
Attributes
String
Optional
Suggested values
not_valid_after
Col User Not Valid Before (colUserNotValidBefore)
Description
The name of the database column indicating the point in time before which a user record is considered not valid yet. The type of this column either DATETIME or TIMESTAMP.
Attributes
String
Optional
Suggested values
not_valid_before
Col Latest Successful Login (colLatestSuccessfulLogin)
Description
Name of the database column with the timestamp of the latest successful login. The type of this column is either DATETIME or TIMESTAMP.
Attributes
String
Optional
Suggested values
lat_succ_login
Col Second Latest Successful Login (colSecondLatestSuccessfulLogin)
Description
Name of the database column with the timestamp of the second latest successful login. The type of this column is either DATETIME or TIMESTAMP.
Attributes
String
Optional
Suggested values
lat_succ_login2
Col Latest Login Attempt (colLatestLoginAttempt)
Description
Name of the database column with the timestamp of the latest attempted login (regardless of success or failure). The type of this column is either DATETIME or TIMESTAMP.
Attributes
String
Optional
Suggested values
lat_login_attempt
Col First Login (colFirstLogin)
Description
Name of the database column with the timestamp of very first login of this user. The type of this column is either DATETIME or TIMESTAMP.
Attributes
String
Optional
Suggested values
first_login
Col Unlock Attempts (colUnlockAttempts)
Description
Name of the database column with the number of attempts of unlocking the user (e.g. through self-unlocking). The type of this column is NUMBER.
Attributes
String
Optional
Suggested values
unlock_attempts, UNLOCK_ATTEMPTS
Col Latest Unlock Attempt (colLatestUnlockAttempt)
Description
Name of the database column with the timestamp of the last unlock attempt of this user. The type of this column is either DATETIME or TIMESTAMP.
Attributes
String
Optional
Suggested values
lat_unlock_attempt, LAT_UNLOCK_ATTEMPT
Col Self Registered Flag (colSelfRegisteredFlag)
Description
Name of the database column with the flag indicating if the user is self-registered. This column type is either CHAR or NUMBER. The value "0" is treated as false, any other value is treated as true.
If this column is not specified, it will be assumed that no users are self-registered.
Attributes
String
Optional
Suggested values
self_registered
Col Self Registration Date (colSelfRegistrationDate)
Description
Name of the database column with the timestamp of the user's self-registration. The type of this column is either DATETIME or TIMESTAMP.
Attributes
String
Optional
Suggested values
self_registration_date
Col Realm (colRealm)
Description
Name of the database column containing the realm of the user.
Setting this column is mandatory when using the Multi-Realm feature. The column specified here must not also be used as the database column of a Context Data Item.
Attributes
String
Optional
Suggested values
realm
Col Channel Verification Resends (colChannelVerificationResends)
Description
Name of the database column holding the number of completed resends of the channel verification token during the user's self-registration. The type of this column is NUMBER.
If this column is not specified, the number of allowed resend attempts is not limited.
Attributes
String
Optional
Suggested values
channel_verification_resends
Col Last GSID (colLastGSID)
Description
Name of the database column with the last global session id.
Attributes
String
Optional
Suggested values
last_gsid_value
Col Last GSID Date (colLastGSIDDate)
Description
Name of the database column with the last update timestamp for the global session id.
Attributes
String
Optional
Suggested values
last_gsid_date
Col Secret Questions Enabled (colSecretQuestionsEnabled)
Description
The name of the database column with the flag indicating whether secret question features are enabled for the user or not.
Attributes
String
Optional
Suggested values
secret_questions_enabled
Additional Where Clause (additionalWhereClause)
Description
Optional SQL query condition that is added to the where clause when searching the user by user name.
The SQL query without an additional where clause is SELECT * FROM usertable WHERE colusername = 'username' (real values for "usertable", "colusername" are taken from the configuration and "username" is taken from the user name input field of the login mask.
The SQL query with an additional where clause xyz is: SELECT * FROM usertable WHERE colusername = 'username' AND xyz
. Example: If the value of this configuration setting is "GROUP = 'cus1' AND MANDATE = 'abc'" the resulting query is SELECT * FROM usertable WHERE colusername = 'username' AND GROUP = 'cus1' AND MANDATE = 'abc'
See also property search-condition-query: It offers a more powerful (although slightly less efficient) way to control the set of valid users.
Attributes
String
Optional
Example
GROUP = 'cus1' AND MANDATE = 'abc'
Example
deleted=0
Additional Iterator Where Clause (additionalIteratorWhereClause)
Description
Optional SQL query condition that is added to the where clause when iterating over users.
The SQL query without an additional where clause is SELECT colusername FROM usertable (real values for "usertable", "colusername" are taken from the configuration.
The SQL query with an additional where clause xyz is: SELECT colusername FROM usertable WHERE xyz
. Example: If the value of this configuration setting is "GROUP = 'cus1' AND MANDATE = 'abc'" the resulting query is SELECT colusername FROM usertable WHERE GROUP = 'cus1' AND MANDATE = 'abc'
See also property search-condition-query: It offers a more powerful (although slightly less efficient) way to control the set of valid users.
Attributes
String
Optional
Example
GROUP = 'cus1' AND MANDATE = 'abc'
Example
deleted=0
Iterator Query (iteratorQuery)
Description
This query is used to get all user ids (or all matching user ids) instead of the default generated query defined by the user table, the username column and the context data fields.

Specifying such a query is only necessary if the username cannot be used as primary key in the user table (this only if property "User Name Resolve Query" is specified).

The query must be such that it returns one-column records one username (userid) per row.

Note that his query is used both when returning all user ids and when returning only matching user ids (filtered by the user). Thus, the query must be such that LIKE-clauses against context data columns work. This usually means that you must join the result with the user table (even if the user id is not read from the usertable) so the LIKE-clauses can access the context data of the user table. Failing to do so will result in runtime SQL syntax exceptions!

Note: If this property is specified, "Additional Iterator Clauses" and the deleted flag is ignored. They must be part of the query itself!

Attributes
String
Optional
Example
SELECT p.id from PERSON p, User u where u.person_id = p.id
Search Condition Query (searchConditionQuery)
Description
A way to limit the set of valid users with an arbitrary SQL query.
(See also configuration property additional-where-clause: it offers a different, slightly more efficient but less powerful way to limit the set of valid users).
After the user has been found by username (and matching the optional additional where clause as specified by configuration property additional-where-clause) the query specified by this configuration property is executed. If the result of the query is true or 1, the user is considered valid. In all other cases, the user is not valid, i.e. the behaviour is as if the user would not exist.

The value of this configuration property can be empty (no effect) or any valid SQL query. You can use values of the user record (Record selected from table specified by configuration property user-table-name by user name and optionally additional where clause) in the query as follows: ${xxx} refers to the field (column) xxx from the selected user record.

Example: In our example the selected user record has the following values (column name = value): user_id = 'freddie', person_no = 13, ...
Further, there is a different database table PERSON which is referenced by the user table. The table PERSON has a column of type boolean called "valid" which indicates whether a person record is valid or not. Consider the following value for this configuration property: SELECT p.valid FROM PERSON p WHERE p.person_no = ${person_no}
Thus, when looking for the user record (given the username and the matching the optional additonal where part), the above query is executed where ${person_no} is substituted by the value 13 of field person_no of the selected user record.

Attributes
String
Optional
Example
SELECT p.valid FROM PERSON p WHERE p.person_no = ${person_no}
Context Data Columns (contextDataColumns)
Description

A list of database columns that are loaded/stored in the user's context data container.

Use either an appropriately typed instance (preferred) or the legacy type using auto-detection (the default up to IAM 6.4).

Attributes
Plugin-List
Optional
Assignable plugins
Additional Context Data (additionalContextData)
Description
This selector allows to read context data from other tables by executing the specified query. The selector of this configuration property specifies the name of the context data variable to be read. The value of this configuration property may be empty (no effect) or any valid SQL query. You can use the values of the user record (Record selected from table specified by property user-table-name by user name) in the query as follows: ${xxx} refers to the field (column) xxx from the selected user record.

Note: These context data values are read only! When fetching user records, the query will be executed for each user and the values will be added to the context data container. Modified, new or deleted values will not be written when user records are updated.

Also note that context data fields defined in configuration property context-data-columns override corresponding entries in this property.

Example:
SELECT p.mobile_no FROM person p WHERE p.person_no = ${person_no}

Attributes
Plugin-List
Optional
Assignable plugins
Col Deleted (colDeleted)
Description
The name of a column that marks a record as deleted. A record that has been marked as deleted is ignored by this persister.
Note: If a user is deleted and this property is defined, the record is only marked as deleted and not really removed from the database! If this property is not defined and a user is deleted, the record is deleted from the database. The type of this column is either NUMBER (recommended) or CHAR. The value "1" represents a deleted user, "0" represents a non-deleted user.
Attributes
String
Optional
Suggested values
deleted
Col Version Id (colVersionId)
Description
Name of a database column containing a numerical version id that is automatically incremented by one when a record is changed.
Such a technical column is used by some applications or libraries (such as Hibernate) to implement optimistic locking.

Note that this plugin still uses its own data-based optimistic locking mechanism. It just increments the value within a transaction in order to be compliant with other components' locking mechanisms.

The column must be of an integer type. Usually a long type is used.

Attributes
String
Optional
Suggested values
rowVersionId
Col Record Insertion Date (colRecordInsertionDate)
Description
Name of a database column with the date and time this record was created. The timestamp is written by this plugin at the time the record is inserted by this plugin.

The type of the column must be compatible with a timestamp.

Note that - if configured (see separate property) - user information may also be written to the database at the same time.

Attributes
String
Optional
Suggested values
rowInsertDate
Col Record Insertion User (colRecordInsertionUser)
Description
Name of a database column with the name of the system that inserted the record. The name is determined by configuration property "Record Modification User" and is written by this plugin at the time the record is inserted by this plugin.

Note that - if configured (see separate property) - the insertion date may also be written to the database at the same time.

Attributes
String
Optional
Suggested values
rowInsertUser
Col Record Modification Date (colRecordModificationDate)
Description
Name of a database column with the date and time this record was modified. The timestamp is written by this plugin at the time the record is modified (or created) by this plugin.

The type of the column must be compatible with a timestamp.

Note that - if configured (see separate property) - user information may also be written to the database at the same time.

Attributes
String
Optional
Suggested values
rowUpdateDate
Col Record Modification User (colRecordModificationUser)
Description
Name of a database column with the name of the system that modified the record. The name is determined by configuration property "Record Modification User" and is written by this plugin at the time the record is modified (or created) by this plugin.

Note that - if configured (see separate property) - the modification date may also be written to the database at the same time.

Attributes
String
Optional
Suggested values
rowUpdateUser
Record Modification User (recordModificationUser)
Description
Specifies a string (typically the name associated with the system using this plugin) that is written to the database fields specified by properties "Col Record Insertion User" and "Col Record Modification User" when this plugin creates or modifies a user record.
Attributes
String
Optional
Default value
Medusa
Suggested values
Airlock
Additional Insert Data (additionalInsertData)
Description
This property defines a list of name/value pairs used in insert statements when a new record is inserted.

This allows you to add arbitrary fixed or dynamic values when a new record is created. This is useful if some database fields may not be NULL but are not inserted by this plugin by default.

Caution: Make sure to appropriately escape values (e.g. use single quotes around strings). They are used as provided in the SQL insert statements. This allows calling database dependent functions (e.g. in order to get a sequence number, system date, etc).

Caution: If the columns specified here are the same as configured in the context data fields or in any "Col ..." property, remove them from the other places for this persister instance.

Attributes
Plugin-List
Optional
Assignable plugins
Rowset Range Pattern (rowsetRangePattern)
Description

This property only has an effect if used in connection with a "Database User Store".

A string formatter pattern describing how to constrain the result set to a subrange of all results. Set this value in case Airlock IAM cannot determine the optimal query pattern automatically.

The first argument is the number of rows to skip (offset), and the second argument is the number of rows to return (limit).

If no pattern is set, Airlock IAM will attempt to automatically determine the query based on the database type.

Commonly used patterns:

  • LIMIT %2$d OFFSET %1$d for MySQL, MariaDB, H2, HSQLDB, PostgreSQL, SQLite
  • OFFSET %1$d ROWS FETCH NEXT %2$d ROWS ONLY for SQL:2008 standard, Derby, SQL Server 2012, Oracle 12c
Attributes
String
Optional
Suggested values
LIMIT %2$d OFFSET %1$d, OFFSET %1$d ROWS FETCH NEXT %2$d ROWS ONLY
Case Sensitive Exact Matching (caseSensitiveExactMatching)
Description

This property only has an effect if used in connection with a "Database User Store".

A String formatter pattern describing how to compare a string field on equality, case sensitive.

If the database is already case sensitive (most DBs, except MySQL and MariaDB) the default value can be used.

The argument (%s) is the name of the field to compare, and the question mark is the value to be searched for.

Commonly used patterns:

  • %s = ? – in most cases
  • BINARY `%s` = ? – for MySQL and MariaDB databases with standard (case insensitive) settings
Attributes
String
Optional
Default value
%s = ?
Suggested values
%s = ?, %s = BINARY ?
Case Sensitive Matching (caseSensitiveMatching)
Description

This property only has an effect if used in connection with a "Database User Store".

A String formatter pattern describing how to search in a string field, case sensitive.

If the database is already case sensitive (most DBs, except MySQL and MariaDB) the default value can be used.

The argument (%s) is the name of the field to compare, and the question mark is the value to be searched for. Important: This is used for approximate matching, e.g. "contains" matching, where the search value could be like "%bla%", thus the "LIKE" operator must be used instead of the equality sign.

Commonly used patterns:

  • %s LIKE ? – in most cases
  • %s LIKE BINARY ? – for MySQL and MariaDB databases with standard (case insensitive) settings
  • %s COLLATE latin1_general_cs LIKE ? – alternative for MySQL and MariaDB, possibly more efficient, but collation must be known
Attributes
String
Optional
Default value
%s LIKE ?
Suggested values
%s LIKE ?, %s LIKE BINARY ?, %s COLLATE latin1_general_cs LIKE ?
Case Insensitive Exact Matching (caseInsensitiveExactMatching)
Description

This property only has an effect if used in connection with a "Database User Store".

A String formatter pattern describing how to compare a string database field on equality, case insensitive.

If the database is already case insensitive (e.g. MySQL and MariaDB) the default value can be used.

The argument (%s) is the name of the field to compare, and the question mark is the value to be searched for. For some databases a less efficient "LIKE" operator has to be used for this.

Depending on used DB and version, as well as the specific setup, different values can be the most efficient. For large user repositories, a DB expert might be consulted or tests with different settings should be performed.

Commonly used patterns:

  • LOWER( %s ) = LOWER ( ? ) – works for most DBs, tested with Oracle DB. Note that this is only really efficient, if a lower-case index is created for the relevant columns.
  • %s COLLATE latin1_general_ci = ? – recommended for MSSQL.
  • %s = ? – for databases with default case insensitive matching, e.g. MySQL and MariaDB with standard settings
Attributes
String
Optional
Default value
LOWER( %s ) = LOWER ( ? )
Suggested values
%s = ?, LOWER( %s ) = LOWER ( ? ), %s COLLATE latin1_general_ci LIKE ?
Case Insensitive Matching (caseInsensitiveMatching)
Description

This property only has an effect if used in connection with a "Database User Store".

A String formatter pattern describing how to compare a string database field on equality, case insensitive.

If the database is already case insensitive (e.g. MySQL and MariaDB) the default value can be used.

The argument (%s) is the name of the field to compare, and the question mark is the value to be searched for. Important: This is used for approximate matching, e.g. "contains" matching, where the search value could be like "%bla%", thus the "LIKE" operator must be used instead of the equality sign.

Depending on used DB and version, as well as the specific setup, different values can be the most efficient. For large user repositories, a DB expert might be consulted or tests with different settings should be performed.

Commonly used patterns:

  • LOWER( %s ) LIKE LOWER ( ? ) – works for most DBs, tested with Oracle DB. Note that this is only really efficient, if a lower-case index is created for the relevant columns.
  • %s COLLATE latin1_general_ci LIKE ? – recommended for MSSQL.
  • %s LIKE ? – for databases with default case insensitive matching, e.g. MySQL and MariaDB with standard settings
  • %s ILIKE ? – for PostgreSQL databases
Attributes
String
Optional
Default value
LOWER( %s ) LIKE LOWER ( ? )
Suggested values
%s LIKE ?, LOWER( %s ) LIKE LOWER ( ? ), %s COLLATE latin1_general_ci LIKE ?, %s ILIKE ?
YAML Template (with default values)

type: DatabaseUserPersister
id: DatabaseUserPersister-xxxxxx
displayName: 
comment: 
properties:
  additionalContextData:
  additionalInsertData:
  additionalIteratorWhereClause:
  additionalWhereClause:
  caseInsensitiveExactMatching: LOWER( %s ) = LOWER ( ? )
  caseInsensitiveMatching: LOWER( %s ) LIKE LOWER ( ? )
  caseSensitiveExactMatching: %s = ?
  caseSensitiveMatching: %s LIKE ?
  colAuthMethod:
  colAuthMigrationDate:
  colChannelVerificationResends:
  colDeleted:
  colFailedLogins:
  colFailedLoginsBeforeLatestLogin:
  colFailedPasswordResets:
  colFailedTokenCounts:
  colFirstLogin:
  colLastGSID:
  colLastGSIDDate:
  colLatestLoginAttempt:
  colLatestPasswordChange:
  colLatestSuccessfulLogin:
  colLatestUnlockAttempt:
  colNextAuthMethod:
  colNextEnforcedPasswordChange:
  colOtherCredentialsDeliveryTimestamps:
  colPassword:
  colPasswordChangeForced:
  colPasswordDeliveryDate:
  colPasswordGenerationDate:
  colPasswordOrderedDate:
  colPasswordOrderedFlag:
  colPasswordOrderedUser:
  colRealm:
  colRecordInsertionDate:
  colRecordInsertionUser:
  colRecordModificationDate:
  colRecordModificationUser:
  colRoleString:
  colSecondLatestSuccessfulLogin:
  colSecretQuestionsEnabled:
  colSelfRegisteredFlag:
  colSelfRegistrationDate:
  colTotalLogins:
  colUnlockAttempts:
  colUserLockDate:
  colUserLockReason:
  colUserLocked:
  colUserName:
  colUserNotValidAfter:
  colUserNotValidBefore:
  colUserValid:
  colVersionId:
  contextDataColumns:
  defaultAuthMethod:
  defaultNextAuthMethod:
  grantRoles:
  isPwdHashStringType: true
  iteratorQuery:
  recordModificationUser: Medusa
  rolesQuery:
  rowsetRangePattern:
  searchConditionQuery:
  sqlDataSource:
  userChangeEventListeners:
  userNameResolveQuery:
  userTableName: