eMondrian Community runs behind an authentication gateway with Keycloak. The gateway is the only published port: the browser pages, /xmla, the REST API and MCP all go through it.

The REST API (/api/v1) uses the same sign-in, the same roles and the same access log as /xmla.

Users sign in with an account kept in Keycloak, in Active Directory or in another LDAP directory. Sign-in through an external identity provider over OIDC or SAML, such as Microsoft Entra ID, Google, Okta or ADFS, can be added to the login page. Rights are set per group. An AI agent connected over MCP acts as the user who signed in and sees only the data that user may see.

After setup, authentication is off. You can try everything without logging in. Switch it on before other people get access.

This page describes Community release 2026.11.16.1 and later. The full reference is auth/README.md in the repository.

Open mode: authentication off

With authentication off, everyone who can reach the port is the user guest and a server administrator. They can:

EndpointWhat they can do
/xmlaQuery all data in all catalogs
/schema-editor/Read and change schemas
/catalog-editor/Read and change data sources and catalogs, including database connection strings and the credentials in them
/logs/Read server logs, including queries and SQL
/emondrian/mcp (and /emondrian/mcp/sse)Use all MCP tools: query data, overwrite schemas, delete catalogs, install JDBC drivers, read logs
/dashboard/Open, change and delete dashboards
/See installed licenses and activate license keys

Open mode is for a trusted network only

Without authentication, everyone who can reach the server is its administrator. They can do everything in the table above. Changes made in open mode stay after you switch authentication on.

Run open mode only where you trust every person and every machine that can reach the server, and never on the internet. Before you switch authentication on for a server that was open on a shared network, check its schemas, settings and installed modules, or install it again.

Since 2026.11.20, pages on other web sites can’t call /xmla or /api from a browser, in open mode or not, unless their origin is listed under cors.allowed_origins in auth/identity.yml (see CORS).

Switch authentication on

./auth/scripts/authentication.sh on       # Linux
.\auth\scripts\authentication.ps1 on      # Windows

off and status work the same way. Nothing restarts and no data changes.

  1. Open the main page and log in as admin with the password 0. Choose a new password of at least 8 characters. Until you do, the password works nowhere else.
  2. Set PUBLIC_URL in .env to the address users open, for example https://bi.example.com, and run docker compose up -d.
  3. Turn on HTTPS — see HTTPS.
  4. Add users and give them groups — see below.

The MCP tool set_open_access switches it too. Anybody may switch authentication on; only an administrator may switch it off.

Users

auth/identity.yml says where users come from. After you change it, run ./auth/scripts/apply-config.sh. ./auth/scripts/check-config.sh <user> shows whether a user may log in and which groups eMondrian receives.

SourceHow it works
KeycloakUsers and groups are kept in Keycloak. Manage them in its admin console at PUBLIC_URL/auth/admin/, realm emondrian, or with the MCP tools create_user, set_user_groups and others.
Active Directory or LDAPUsers stay in the directory. Keycloak checks the password there at every login and copies nothing. You can limit logins to the members of chosen groups.
External identity provider (OIDC or SAML)Adds a button to the login page. See the rule below.

Sources can be combined, for example your directory plus a local admin.

Every user who connects must have an account in Keycloak. Signing in through an external provider never creates one. A person the provider knows and Keycloak doesn’t is refused. Create the account first. With link_by_email: true on a provider, a sign-in is linked to the account with the same e-mail address. Set it only for a provider you trust to verify e-mail addresses, such as your own tenant. Users of Active Directory or LDAP count as being in Keycloak.

E-mail and first passwords

A new user can choose their own password from an e-mail, so nobody else learns it: not the administrator and not the agent who created the account. This works with authentication on, through the MCP tools for Keycloak administrators.

Set up mail

Keycloak, which eMondrian uses for sign-in, sends the e-mail through your mail server. Add an smtp section to auth/identity.yml:

smtp:
  host: smtp.example.com
  port: 587                 # default: 587 for starttls, 465 for ssl, 25 for none
  security: starttls        # starttls, ssl or none
  from: [email protected]
  from_name: eMondrian      # optional
  reply_to: [email protected]  # optional
  user: [email protected]      # optional, together with password_file
  password_file: smtp-password   # a file in auth/secrets/

Then run auth/scripts/apply-config.sh. It writes the settings to Keycloak and logs a line smtp: host:port (security), from ….

Send the e-mail

An administrator’s agent sends it when creating the user, or later:

  • create_user with email and send_password_email: true creates the user with no password and sends the e-mail. It can’t be combined with password or temporary_password.
  • send_password_email with username sends it again, for example when the link has expired.

“Create an account anna.smith for Anna Smith ([email protected]), put her in /customers/acme, and send her an e-mail to set her own password.”

The user gets an e-mail with a link to choose a password. The link works for 24 hours; after that the page says the action has expired, and the agent sends a new e-mail. After setting the password, the user sees Keycloak’s Account updated page and then opens eMondrian, or the dashboard link they were sent, and signs in.

The e-mail comes from the from address in smtp. Its text is Keycloak’s standard message Update Your Account, in English. Change the text or the language in Keycloak: the realm’s localization and e-mail theme.

Without mail

If no mail server is set, send_password_email answers that Keycloak could not send the e-mail. create_user with send_password_email: true still creates the user, with no password, and says in its answer that the e-mail was not sent.

Without mail, the user works with a personal token instead: an administrator issues it at PUBLIC_URL/account/tokens?user=<name> and gives it to the user (see Personal tokens). create_user never sets a password: since Community 2026.11.20.2 it refuses password and temporary_password, because a password someone chose is known to them, and one given to an agent passes through it.

Groups and rights

Every user who logs in gets in. eMondrian receives the user name and the user’s groups, never the password, and decides what the user may see and do.

Groups are named by their full path, top-level groups too: /emondrian-admins, /Sales/WebAppUsers. A plain name such as emondrian-admins matches nothing. Membership isn’t inherited: a right for /Sales doesn’t reach the members of /Sales/WebAppUsers. Groups from an external provider arrive under the source’s name, for example /entra/BI-Users, so a provider can never grant a Keycloak group.

Server rights are set per group in auth/security/security.properties, the only place for them. The server reads the file read-only. Setup creates three groups:

GroupMay
/emondrian-adminsEverything: edit schemas and catalogs, read logs, install license keys, manage all dashboards
/emondrian-editorsEdit schemas, read the catalog list
/emondrian-viewersRead schemas and the catalog list

Querying data needs no server right. Add your directory’s groups to the lines of that file and save it: the change applies at the next request, with no restart.

Members of /emondrian-admins are also administrators of the Keycloak realm: they manage users, groups, providers and token settings. Keep this group small, and don’t create groups inside it.

Which data a user sees is set by roles in the schema. A role applies to the users and groups named in its <RoleMember> elements:

<Role name="Sales EMEA">
  <SchemaGrant access="none">
    <CubeGrant cube="Sales" access="all"/>
  </SchemaGrant>
  <RoleMember name="/Sales-EMEA"/>   <!-- a group, by its path -->
  <RoleMember name="jdoe"/>          <!-- or a user -->
</Role>

No matching role means full access

A user who matches no role gets the schema’s defaultRole. Without a defaultRole, that is full access to the schema. Give a schema a restrictive defaultRole before you rely on roles.

See Schema reference for the grants.

How clients log in

ClientWith authentication on
BrowserLogin page. PUBLIC_URL/logout logs out.
ExcelServer PUBLIC_URL/xmla, Use the following User Name and Password
Power BI DesktopServer PUBLIC_URL/xmla, then Database with a user name and password
ScriptsHTTP Basic, for example curl -u jdoe https://bi.example.com/xmla …
AI agents (MCP)OAuth login in the browser, or an Authorization header — see AI agents (MCP)

A user of an external provider has no password in Keycloak, so they need a personal token for Excel and Power BI.

Personal tokens

Every user has at most one personal token (emk_…), for everything that can’t sign in through a browser:

WhereHow
Excel, Power BI (import)Server PUBLIC_URL/xmla, the owner’s user name, the token as the password
Power BI live connectionServer PUBLIC_URL/xmla?emondrian_token=emk_…: Power BI Desktop’s Connect live sends no saved password
Scripts, the REST API, AI agentsAuthorization: Bearer emk_…. Never in the address: the REST API refuses that
A link to a dashboardPUBLIC_URL/dashboard/d/<id>?emondrian_token=emk_… — see Dashboard access

Who issues. A user issues their own at PUBLIC_URL/account/tokens (or Power BI live connection on the main page). A member of /emondrian-admins issues one for any user on the same page (For user, or ?user=<name>&dashboard=<id> in the address), or with the tokens API below. Any administrator can issue a token for any user; not for another administrator unless personal_tokens.issue_for_admins: true. The token is shown once; the server keeps only its SHA-256.

One token, one consumer. Issuing a new token revokes the user’s current one, and everything that uses it stops within 30 seconds. So give each consumer its own user: a portal’s backend one, a client’s links another, both in the client’s group with the same role. Revoking one then stops nothing else, and the access log shows by name which of them called. A user whose token goes into a link may only read.

A token follows its owner. The gateway asks Keycloak, at most every 30 seconds, whether the owner still exists and is enabled, and which groups the owner has now. A disabled or deleted owner’s token stops working within 30 seconds, and so does a revoked one. Tokens last 90 days unless the issuer sets fewer or more days, up to personal_tokens.max_lifetime (365 days).

The tokens API, for scripts and automation, at PUBLIC_URL/account/api/tokens:

RequestAnswer
POST {"user"?, "name"?, "days"?}201 with token (once), id, owner, expires, created_by and replaced, the ids it revoked
GET (?user=<name>; ?all=1 for administrators)The active tokens, never their values: name, created, expires, last used, issued by
DELETE /<id>Revokes it: your own, or any for administrators
curl -u admin -H 'Content-Type: application/json' https://bi.example.com/account/api/tokens \
     -d '{"user": "acme-portal", "name": "Acme portal backend", "days": 90}'

It signs in with a password (Basic) or a sign-in’s Bearer token. A personal token can’t issue or manage tokens (401), so a stolen token can’t renew itself. Errors are {"error": {"code", "message"}}: 400 (days above the maximum), 401, 403 (not an administrator, another administrator, or an agent — below), 404 (no such user, or disabled), 429 (more than 10 wrong passwords a minute from one address).

A token a script prints stays in the CI log, and one Terraform writes stays in its state in clear text. Keep both as secret as the token.

AI agents and tokens

personal_tokens.issue_via_agents in auth/identity.yml is off by default. Then no token passes through an AI agent:

  • the MCP tool create_token answers with the page PUBLIC_URL/account/tokens?user=<name>&dashboard=<id> for an administrator to open in a browser;
  • the tokens API refuses a Bearer token issued to any program other than the gateway itself: MCP clients, emondrian-cli, any other OAuth client. The page and a password (Basic) are not affected.

list_tokens and revoke_token work either way and never show a value. With issue_via_agents: true, create_token returns the token, the Power BI address and the dashboard’s link.

What the switch does not cover, because the gateway can’t tell these from the person:

  • an agent that has a user’s or an administrator’s password and a shell, and calls the API with curl -u;
  • an agent that drives a browser with an administrator’s session. Don’t sign in as an administrator in a browser an agent controls;
  • access to the server itself (its containers, SESSION_SECRET), or to Keycloak’s admin console or API.

A token in an address

The gateway takes a token in the address only on /xmla and on a dashboard page. It removes that one parameter before the request goes on, so eMondrian and the Dashboard never see it, and masks it in its access log. Still, an address is copied where a password never goes:

  • Power BI and Excel files keep the server address: a .pbix or .odc file shared as a file shares the token. Share reports through the Power BI service with its own credentials instead.
  • Link previews in messengers and mail scanners open the address themselves, so the token reaches their servers.
  • The browser history keeps a dashboard link as it was before the gateway reloaded it without the token, and the address bar offers it again.
  • nginx’s own error lines quote the address as it arrived: keep the gateway’s container log as private as the server itself.

Settings

personal_tokens:            # in auth/identity.yml; defaults shown
  enabled: true
  default_lifetime: 90d
  max_lifetime: 365d
  issue_via_agents: false
  issue_for_admins: false

Then auth/scripts/apply-config.sh. Until Community 2026.11.20.1 a separate XML/A link (eml_…) did the address’s work, and a user could have up to 10 tokens. Since 2026.11.20.2 the links no longer work, a user who had several tokens keeps the newest, and xmla_links and max_per_user are ignored with a warning.

HTTPS

Without HTTPS, passwords travel unencrypted, and the login page works only in a browser on the server itself.

Put the certificate and its key into auth/secrets/tls/ as tls.crt and tls.key. In .env, set PUBLIC_URL=https://bi.example.com and EMONDRIAN_TLS_PORT=443. Run docker compose up -d. Excel and Power BI accept only certificates that Windows trusts: use one from your organisation’s CA or a public one. Step by step: HTTPS.

AI agents that log in with OAuth from another machine need HTTPS. Claude Code and other MCP clients refuse to send a login to a token endpoint over plain HTTP, except on localhost.

AI agent access management: role-based access control (RBAC) for AI agents

AI agent access management in eMondrian works through the user: an AI agent signs in as a person, with OAuth, a password or a personal access token, and gets exactly that person’s roles. The agent acts on behalf of the user, with the signed-in user’s permissions, and does not expand data access: it sees the same cubes, members and rows as that user in Excel and Power BI.

With authentication on, every MCP tool call runs as the person who logged in:

  • Data. The schema roles decide which cubes and members the agent sees: the same row-level and object-level security as in Excel for that user.
  • Changes. The server rights decide what the agent may change. Saving a schema needs schema.write, and reading logs needs logs.read.
  • Formulas. describe_cube shows the formulas of calculated measures to users who may read the schema.
  • Identity. Users and groups come from your identity provider: Keycloak, Active Directory, LDAP, or OIDC and SAML providers such as Microsoft Entra ID and Okta. Roles and rights are granted to groups, so a person who moves to another group takes their agent’s access with them.
  • Audit log. logs/mcp-audit.log records each call with the user’s name, the tool, the catalog and the query.

Follow least privilege: give a person who uses an agent only the access you’d give that agent, and keep schema.write and database.manage for the groups that build the model. Query results go to the agent and to its model provider. To keep real data out of the agent’s chat altogether, let agents work on a synthetic twin: AI agent data security: keep company data and passwords out of the agent’s chat.

How do I set up role-based access control for AI agents? Define data roles in the schema and grant server rights in security.properties, both to groups from your identity provider. An agent gets the roles and rights of the user it signs in as.

Does an MCP server support row-level security? The eMondrian MCP server applies the row-level and object-level security of the schema roles to every query the agent runs.

Can an AI agent see data the user is not allowed to see? The agent sees only what its user may see, through the same roles as Excel and Power BI.

Does the agent need its own database credentials? The database credentials stay on the eMondrian server. The agent signs in as a person.

With authentication off, every agent is guest with all rights.

Dashboards

With authentication on, only logged-in users open /dashboard/.

  • Data follows the viewer’s roles. The data in each visual is read in the viewer’s browser through the gateway, so the schema roles of that user apply. A user who may not see the data doesn’t see it on a dashboard either.
  • Each dashboard has its own rights. A new dashboard is open to its creator and to the dashboard administrators, who give others the right to view or edit it. The list shows each user only the dashboards that user may view. See Dashboard access.

Known limits

LimitWhat it meansWhat to do
A change takes time to reach open connectionsA disabled user, a new password or a removed group reaches Excel and Power BI within about 5 minutes, and personal tokens within 30 seconds. An OAuth token stays valid until it expires, up to 5 minutes plus 60 seconds. An open XML/A session keeps its role until it ends.For an urgent block, also restart the server: docker compose restart eMondrian.
Provider groups refresh at sign-inThe groups of an external provider are those of the user’s last login through it.Ask the user to sign in again after a group change.
A user with no groups sees schemas without roles in fullLogging in is enough to query.Give every schema a restrictive defaultRole.
Instructions hidden in your dataText in the data, such as member names or descriptions, reaches the agent as tool results. An agent may follow instructions planted there (“prompt injection”).Don’t let an agent act on query results without a person in the loop. Be careful with free-text columns from untrusted sources.
No row limit and no timeout for MCP queriesOne query over a large fact table can hold a database connection and the server’s memory for minutes.Set mondrian.rolap.queryTimeout. Give the database user a resource limit.
Logs contain dataLogs hold queries, generated SQL, member names and filter values. mondrian-mdx.log doesn’t name the user of an MCP query; mcp-audit.log does.Give logs.read only to administrators. Delete logs after the period you need.
One installation per Docker hostA second copy on the same host can’t run beside the first.Use a separate host or virtual machine.

Recommendations

  1. Switch authentication on before anyone else can reach the server, and change the admin password.
  2. Use HTTPS for anything beyond your own machine.
  3. Give every schema a restrictive defaultRole.
  4. Use a read-only database user. eMondrian only reads data. See Connect databases.
  5. Keep /emondrian-admins small. Its members administer the server and Keycloak.
  6. Protect .env and auth/secrets/. They hold the secrets of the installation. Keep them out of version control and out of backups that others can read.
  7. Disable services you don’t use in .env, for example ENABLE_SERVICE_SCHEMA_EDITOR=false, ENABLE_SERVICE_CATALOG_EDITOR=false, or ENABLE_SERVICE_MCP=false if no AI agents connect.
  8. Narrow CORS. Set CORS_ALLOW_ORIGIN in .env to the one web application that needs browser access.

Production support

BIS supports production deployments of eMondrian: see emondrian.com/pricing or contact [email protected].