Configuration

Users (authentication and authorization via Database)

This page describes how Anjana Data Platform manages user authentication and authorization through the Users table in the Configuration Panel, with particular focus on the internal Database provider.

  • Authentication (who are you?): verifies the user's identity when they log in.

  • Authorization (what can you do?): determines the user's permissions based on the roles assigned to them. Authorization management (assigning roles to users in organizational units) is described on the page https://wiki.anjanadata.com/es/configuracion/26.1/autorizacion .

Important: the Users table always contains the users who can authenticate on the platform, regardless of the configured authentication provider (Database, LDAP/AD, Azure EntraID, Google, AWS, etc.). If a user does not exist in the Users table, they will not be able to authenticate, not even with the default role.

image-20251201-162500.png
Access to the Users configuration in the Configuration Panel

Structure of the Users table

The Users table stores the information of each user who can authenticate and be authorized on the platform.

To view and access the Users table within the Configuration Panel, the user must have a role with permissions for the CREDENTIAL_ADMIN action on the ANJANA subtype.

image-20260720-095531.png

Each user is defined by the following fields:

  • id: unique identifier of the user in the table.

  • userName: login identifier of the user in the application or in the integrated identity provider. It is a unique-value field in the table (see User identification and authorization). The userName is also the identifier with which Anjana Data Platform records the audit trail: when the platform indicates, for example, that the user who modified a business term is lucia.gomez, that value is the userName.

  • firstName: user's first name.

  • lastName: user's last name.

  • email: user's email address. It can also be used as an access identifier (see User identification and authorization).

  • phone: user's phone number.

  • title: user's job title (informational field, not mandatory).

  • Password: hash of the user's password in BCrypt format. The hash is unique per user, even for identical passwords, and can be generated with any standard BCrypt tool (see Behavior of the Password field).

  • isServiceUser: boolean indicating whether it is a service user (true) or a named user (false).

The attributes of the Users table can be populated through different mechanisms, described in the User creation section: synchronization with the corporate directory, manual creation from the Configuration Panel, or creation via API.

User identification and authorization

A user's access to the platform is resolved in two phases:

  • Identification (authentication): the identifier returned by the authentication mechanism is compared indistinctly against the userName and email values in the Users table. The comparison is case-insensitive: for example, JGarcia and jgarcia are considered the same value. Therefore, a user can be identified either by their userName or by their email.

  • Authorization: once identified, the user obtains the permissions of the roles assigned to them. These roles are resolved based on the user's record in the Users table (by their Id), not by their userName or email.

Authorization —assigning roles to users within organizational units via the User-Ou-Roles table— is managed and documented on its own page: Authorization. This page (Users) focuses on user authentication and identification; it does not detail the role-assignment mechanism, to avoid duplicating content.

Although userName is a unique-value field in the table (with a uniqueness constraint, even case-insensitive), it is not the only valid access identifier: the email serves the same purpose for identification. In both cases, identification is case-insensitive.

Behavior of the Password field

The Password field stores the BCrypt hash of the password and behaves as follows in the Configuration Panel:

  • On creation and modification, the value entered by the user in the Password field (the hash) is shown in plain text, unmasked.

  • On query, the hash value is not shown: it appears masked for security.

  • Modification does not allow clearing the password content, only modifying it.

  • It is not populated during user synchronization.

image-20260720-130217.png
The Password field is shown masked

Users coming from external providers —that is, those who authenticate through their own provider rather than through Databaseshould not have the password field populated. The Password field is only relevant for authentication via Database, where the user enters the plain-text password that is validated against this hash.

User creation

Users can be added to the Users table through three mechanisms:

Manual creation from the Configuration Panel

Recommended method for creating users individually (path Schemas → Users → New):

  1. Click New.

  2. Fill in the fields described in Structure of the Users table in the creation wizard.

  3. Click Save to save the user or Cancel to discard it.

image-20260720-130419.png
The Password field is shown in plain text during creation

For authentication via Database, the user will use as their password the value (before the hash conversion in BCrypt format), which is validated against the Password field. Upon creation, the hash entered is shown in plain text (see Behavior of the Password field).

Creation via API

Allows automating user provisioning from external processes. See the Zeus users API documentation for more detail.

User synchronization

Retrieves and updates user information from the corporate directory. It is run from Home > Actions > Synchronize users in the Configuration Panel and is detailed on the page https://wiki.anjanadata.com/es/integraciones/26.1/aprovisionamiento-de-usuarios .

Synchronization populates the userName, email, firstName, lastName, phone, and title fields. It does not populate the Password field, since these users authenticate through their external provider rather than through Database.

Modifying users

Modifying a user's attributes should be done with caution.

  1. Go to Schemas → Users in the Configuration Panel; the list of existing users will be displayed.

  2. Locate the user you want to modify; you can filter by userName, email, or other fields in the table.

  3. Click the pencil icon to open the edit panel.

  4. Modify the necessary fields: firstName, lastName, email, phone, title, and Password (only if you want to change the password). Keep in mind the behavior of the Password field described in previous sections.

  5. Save the changes with Save.

Important:

  • For the changes to take effect immediately, it is recommended to clear the caches from Home > Reset operations > Clear cache.

  • It is not recommended to modify values populated through synchronization with the corporate identity management system, unless they are not populated in that system.

Important considerations

  • userName: this is a unique-value field (uniqueness constraint, even case-insensitive) and is used as the login identifier. It is not recommended to modify it unless exceptionally necessary, since it may be referenced in permissions/roles or in user-type attributes of templates. If modified: perform a bulk edit to remove the references in user-type attributes; comply with all field constraints (uniqueness, length, valid characters); the user will need to log in with the new value. Remember that identification also accepts the email (see User identification and authorization).

Impact of changing the userName on the audit trail.

Since the userName is the identifier recorded in the audit trail, changing the userName causes subsequent actions to be audited with the new value, while earlier audit records retain the old userName: the historical audit trail is not rewritten.

  • Password change: modify the Password field with a valid BCrypt hash; the user will use the plain-text password corresponding to that hash at login. On modification, the hash value appears masked. It is not possible to delete a password once created, only to modify it.

  • isServiceUser: informational field. It should not be modified manually unless the platform team indicates so.

Database query and exploitation — Developer view

In addition to being managed from the Configuration Panel, the information of internal users (authentication via Database) is stored in the zeus.users table and can be queried in read-only mode for analytical purposes. For example, it allows the client to build their own data mart, dashboards, or reports on the users of their platform (registrations, service users versus named users, users by domain and role, etc.).

This section is oriented toward querying (read-only) the information. User creation and modification should always be performed from the Configuration Panel (administrator view) or via the Zeus users API, as described in previous sections; writing directly to the tables is not recommended.

Sensitive data: this table contains credentials and personal data.

  • The password_hash field is an encrypted credential: it must not be included in exploitation queries or exposed in a data mart, report, or view.

  • The email, phone, first_name, and last_name fields are personal data; their processing must comply with the data protection regulations applicable to the organization.

The zeus.users table

The information of internal users is stored in the zeus.users table. Its columns, available for querying, are:

Column

Data type

Description

id_user

int4 (INTEGER)

Unique internal identifier of the user (primary key).

email

varchar(254)

User's email address (unique if provided). Personal data.

first_name

varchar(50)

User's first name (optional). Personal data.

last_name

varchar(50)

User's last name (optional). Personal data.

password_hash

varchar(60)

Encrypted credential (BCrypt hash). Must not be queried or exposed in exploitation tasks.

phone

varchar(255)

Contact phone number (optional). Personal data.

title

varchar(255)

User's job title/position (optional).

user_name

varchar(50)

Username for internal login (unique).

is_service_user

bool

Indicates whether it is a service user (default value false).

previous_login

timestamp

Date of the user's last login.

signed

bool

Indicates whether the user has signed the privacy agreement.

Relevant constraints and indexes

  • Primary key: users_pkey (id_user)

  • Email uniqueness: UNIQUE (email)

  • Username uniqueness: UNIQUE (user_name)

  • Case-insensitive username uniqueness:
    CREATE UNIQUE INDEX unique_lower_username ON zeus.users (lower(user_name::text));
    This prevents duplicates due to case differences (for example, jgarcia and JGarcia).

For a more complete view, the users table can be joined with other tables in the model:

  • zeus.user_ou_role: role assignments to users by organizational unit; allows knowing the authorization of each user (linking id_user with user_id).

  • Through user_ou_role, the tables zeus."role" (role) and zeus.organizational_unit (data domain) complete the view of who can do what and where.

Query examples

List of users without the credential (password_hash):

SQL
SELECT id_user,
       user_name,
       first_name,
       last_name,
       email,
       title,
       is_service_user
FROM zeus.users
ORDER BY user_name;

Count of service users versus named users (useful as a metric for a data mart):

SQL
SELECT is_service_user,
       COUNT(*) AS total
FROM zeus.users
GROUP BY is_service_user;

Users with their roles and data domains (effective authorization):

SQL
SELECT u.user_name,
       ou.alias    AS unidad_organizativa,
       r.role_name AS rol
FROM zeus.users u
JOIN zeus.user_ou_role uor        ON u.id_user = uor.user_id
JOIN zeus.organizational_unit ou  ON uor.ou_id = ou.id_organizational_unit
JOIN zeus."role" r               ON uor.rol_id = r.id_role
ORDER BY u.user_name;

Important:

  • Use a database user with read-only permissions and, preferably, on a view that excludes password_hash and limits personal data to what is strictly necessary.

  • User creation and modification should always be performed from the Configuration Panel or the Zeus users API, to maintain integrity (password hashing, uniqueness, caches).

  • Schema, table, and column names may evolve between versions of Anjana Data; it is advisable to validate them before building a data mart or reports on this information.