Platform security and governance
Platform security and governance protect metadata operations from sign-in through the final read or write. The service establishes a trusted identity, resolves the caller's effective access, checks the target metadata and its governance context, and masks data that needs extra protection. Read metadata platform service for the wider service model, service API resources for request handling, and metadata entity lifecycle for the changes these controls protect. See governance workflow automation, alerting and event delivery, platform configuration management, and context center and AI knowledge for connected governance flows.
Security boundary
The security boundary has two linked parts. Authentication proves who sent a request, while authorization decides what that subject may do with a resource. The same boundary also protects login state, delegated actions, client redirects, and sensitive values.
This diagram shows how a credential becomes a protected metadata result.
flowchart LR
A[Credential or login response] --> B[Identity and session checks]
B --> C[Effective subject]
C --> D[Resource and governance context]
D --> E[Policy decision]
E -->|allowed| F[Metadata operation]
E -->|denied| G[Forbidden result]
F --> H[Field and sensitive-data controls]
H --> I[Response or stored change]
Identity and credential trust
Identity handling turns native credentials or an external identity-provider response into a platform principal. The service checks token signature, expiry, deployment issuer, audience, tenant where configured, email shape and verification, allowed domains, provider roles, and the link between an internally issued token and the account it names. Email-first resolution is preferred when configured, but only a missing or invalid email claim may fall back to the configured legacy claim path. Once an email is known, account-state failures do not switch identities. Provider tokens cannot resolve to bot accounts. (openmetadata-service/…/JwtIdentityResolver.java, openmetadata-service/…/ProviderTokenValidator.java, openmetadata-service/…/JwtFilter.java)
Accounts created or found through email-first SSO are also bound to the identity-provider subject. The first valid sign-in records that subject. A later sign-in with the same email but a different subject is refused until an administrator handles the account transfer, which prevents a reassigned address from inheriting another person's account and history. The same read-only check is used by Test Login before it reports that an account would be admitted. (openmetadata-service/…/EmailFirstUserProvisioner.java, openmetadata-service/…/TestLoginAccountChecks.java)
The platform issues its own tokens with claims shaped for the deployment's identity rules. Its tokens use the platform's RSA signing path even when the configured identity provider uses another algorithm. The service checks personal access tokens, bot tokens, MCP OAuth access tokens, and session tokens against current credential or session state, so revocation reaches every server. Bot token maintenance can replace stale tokens, but it skips revoked bot credentials and confirms that a new token matches the configured signing key before saving it. (openmetadata-service/…/JWTTokenGenerator.java, openmetadata-service/…/BotTokenRegenerator.java, openmetadata-service/…/JwtFilter.java)
Native password and LDAP login share the same platform session model. Each handler creates an active server session and returns a short-lived access token bound to that session; refresh uses a lease so concurrent requests cannot rotate one session at the same time. Directory or credential service failures remain distinct from rejected credentials. Basic login also keeps failed-attempt tracking tied to the stored password version, so a password change clears the effective lockout on every server. (openmetadata-service/…/BasicAuthenticator.java, openmetadata-service/…/BasicAuthServletHandler.java, openmetadata-service/…/LdapAuthenticator.java, openmetadata-service/…/LdapAuthServletHandler.java)
SAML responses also need a valid signature result and must be current, intended for this service provider, and sent to its configured consumer endpoint. Configuration validation accepts certificate rollover data when at least one identity-provider certificate is currently valid, while live settings retain the configured trust keys for the runtime trust set. (openmetadata-service/…/SamlResponseValidator.java, openmetadata-service/…/SamlCertificates.java, openmetadata-service/…/SamlSettingsHolder.java)
References: openmetadata-service/…/JwtIdentityResolver.java• L42-81 openmetadata-service/…/ProviderTokenValidator.java• L22-62 openmetadata-service/…/JwtFilter.java• L602-651 openmetadata-service/…/JwtFilter.java• L804-849 openmetadata-service/…/EmailFirstUserProvisioner.java• L86-167 openmetadata-service/…/TestLoginAccountChecks.java• L59-79 openmetadata-service/…/JWTTokenGenerator.java• L84-101 openmetadata-service/…/JWTTokenGenerator.java• L349-376 openmetadata-service/…/BotTokenRegenerator.java• L42-76 openmetadata-service/…/BotTokenRegenerator.java• L110-164 openmetadata-service/…/BasicAuthenticator.java• L441-457 openmetadata-service/…/BasicAuthenticator.java• L503-613 openmetadata-service/…/BasicAuthServletHandler.java• L62-110 openmetadata-service/…/LdapAuthServletHandler.java• L66-110 openmetadata-service/…/SamlCertificates.java• L30-59 openmetadata-service/…/SamlResponseValidator.java• L67-125 openmetadata-service/…/SamlSettingsHolder.java• L98-140
Session and login state
Sessions add server-side control to short-lived access tokens. A session records the provider, user, expiry, refresh state, and pending login data. Requests and refreshes must use an active session for the current provider, while logout, password changes, user off-boarding, and provider changes can revoke access before a token reaches its natural expiry. (openmetadata-service/…/SessionService.java, openmetadata-service/…/JwtFilter.java)
Refresh uses a lease so concurrent requests cannot rotate one session at the same time. Provider rejection ends a session, but an unavailable provider leaves the session available for a later retry. The session lifetime stays bounded even when a provider token is renewed.
External login callbacks bind the provider response to the login that started it. OIDC uses state, nonce, PKCE, a trusted redirect, and an authorization-code exchange; the callback rejects a response without the required code. SAML carries the pending-session identity in RelayState because a cross-site provider POST may not carry the session cookie. The callback validates the SAML response and request binding, attaches the user to the pending session, and redirects with a one-time completion code; only the browser with the original session cookie can activate that login. A browser sign-in failure returns to the sign-in page with a fixed safe error code, while an MCP callback keeps its error for the MCP client. MCP callbacks remain separate from normal web login and fail closed if their bridge is unavailable. (openmetadata-service/…/AuthenticationCodeFlowHandler.java, openmetadata-service/…/SamlAuthServletHandler.java, openmetadata-service/…/SamlResponseValidator.java, openmetadata-service/…/SamlLoginCompletionServlet.java, openmetadata-service/…/SignInFailure.java)
The same OIDC exchange rules apply to the administrator's Test Login. It uses the candidate provider and client settings, checks the returned issuer and nonce, redeems the authorization code, and can check one provider refresh. It stops before user provisioning, platform token creation, session activation, or live configuration changes. (openmetadata-service/…/TestLoginOidcHandler.java, openmetadata-service/…/TestLoginService.java)
References: openmetadata-service/…/SessionService.java• L152-273 openmetadata-service/…/SessionService.java• L310-389 openmetadata-service/…/SessionService.java• L409-523 openmetadata-service/…/SessionService.java• L554-610 openmetadata-service/…/JwtFilter.java• L993-1049 openmetadata-service/…/AuthenticationCodeFlowHandler.java• L457-506 openmetadata-service/…/AuthenticationCodeFlowHandler.java• L575-717 openmetadata-service/…/AuthenticationCodeFlowHandler.java• L813-907 openmetadata-service/…/SamlAuthServletHandler.java• L194-220 openmetadata-service/…/SamlAuthServletHandler.java• L288-377 openmetadata-service/…/SamlAuthServletHandler.java• L447-507 openmetadata-service/…/SamlResponseValidator.java• L80-119 openmetadata-service/…/SignInFailure.java• L15-45 openmetadata-service/…/TestLoginOidcHandler.java• L49-61 openmetadata-service/…/TestLoginOidcHandler.java• L111-151 openmetadata-service/…/TestLoginService.java• L43-61
MCP redirect trust
MCP client registration and authorization use one operator-controlled redirect policy. It limits web redirects to HTTPS hosts on the allowlist, treats loopback and native application redirects as explicit deployment choices, and rejects unsafe schemes, fragments, user information, invalid ports, and oversized values. (openmetadata-service/…/McpClientPolicy.java)
References: openmetadata-service/…/McpClientPolicy.java• L23-69 openmetadata-service/…/McpClientPolicy.java• L71-109
Authorization model
Authorization evaluates an effective subject against a resource and one or more metadata operations. The subject includes the user, administrator or bot status, direct and inherited team access, roles, domains, ownership, and any approved impersonation. The resource context supplies trusted attributes such as owners, domains, reviewers, certifications, tags, and service data.
Subjects and policies
A role groups policies, and a policy groups allow or deny rules for resources and operations. Direct roles and team hierarchy provide the subject's policy set. An owning team's deny rules can still affect an asset, while that team's allow rules do not grant access to people outside the team. (openmetadata-service/…/SubjectCache.java, openmetadata-service/…/SubjectContext.java)
The evaluator applies explicit deny rules before allow rules. A request is denied when a matching deny applies or when every requested operation lacks a matching allow. A disabled policy contributes no rules. Broad operation groups do not silently grant impersonation or unrestricted SPARQL access; those actions need named grants. The same operation matching rules support enforcement and permission diagnostics. (openmetadata-service/…/CompiledRule.java)
Policy conditions express governance facts such as ownership, reviewer status, task participation, team membership, inherited roles, domains, tags, certifications, service attributes, and bot attribution. Attribution conditions describe the bot recorded for a request; they do not prove that an impersonation grant was approved. The condition language accepts only approved expressions and functions. The service validates referenced entities and closed service values when a policy is written, so a typo does not silently disable a deny rule. (openmetadata-service/…/RuleEvaluator.java)
References: openmetadata-service/…/SubjectCache.java• L313-406 openmetadata-service/…/SubjectContext.java• L277-319 openmetadata-service/…/CompiledRule.java• L34-60 openmetadata-service/…/CompiledRule.java• L161-217 openmetadata-service/…/CompiledRule.java• L298-333 openmetadata-service/…/RuleEvaluator.java• L61-168 openmetadata-service/…/RuleEvaluator.java• L239-254 openmetadata-service/…/RuleEvaluator.java• L346-472 openmetadata-service/…/RuleEvaluator.java• L618-698 openmetadata-service/…/RuleEvaluator.java• L736-809
Resource context and operation checks
The resource context gives policy evaluation a trusted view of the target. It loads the bounded fields needed for authorization even when the caller did not request them, and it loads high-cardinality tags only when a condition needs them. For bulk results, shared field hydration avoids changing response shape while keeping policy checks consistent across rows. (openmetadata-service/…/ResourceContext.java, openmetadata-service/…/ResourceContextInterface.java, openmetadata-service/…/BulkFieldHydrator.java)
Create authorization uses persisted parent and service data rather than caller-supplied references. It checks both the domain of the container and each domain named by the request. This prevents an untrusted service stub, owner, reviewer, or domain from granting access during creation. (openmetadata-service/…/CreateResourceContext.java, openmetadata-service/…/RuleEvaluator.java)
The central authorizer applies the same subject resolution and impersonation checks to normal resource access, administrator actions, bots, PII access, and permission views. Reviewer status can help with existing review work, but caller-supplied reviewers cannot authorize a new entity. (openmetadata-service/…/DefaultAuthorizer.java)
Column reads keep the table visible while removing restricted column fields that the caller cannot view. Column profiles use the data-profile operation, and custom metrics use the table's test-view operation. This keeps field-level protection consistent for direct column reads and column search. (openmetadata-service/…/ColumnFieldAccess.java)
References: openmetadata-service/…/ResourceContext.java• L417-513 openmetadata-service/…/ResourceContextInterface.java• L27-103 openmetadata-service/…/BulkFieldHydrator.java• L28-83 openmetadata-service/…/CreateResourceContext.java• L63-115 openmetadata-service/…/CreateResourceContext.java• L140-203 openmetadata-service/…/RuleEvaluator.java• L169-254 openmetadata-service/…/DefaultAuthorizer.java• L170-213 openmetadata-service/…/DefaultAuthorizer.java• L243-321 openmetadata-service/…/DefaultAuthorizer.java• L335-368 openmetadata-service/…/ColumnFieldAccess.java• L17-105
Read and row filtering
Read access is tied to the fields returned, not only to the endpoint name. A field with a registered view operation uses that operation, while an unknown field requires the broad view operation. A column read can therefore return its ordinary fields while dropping profile or custom-metric fields that need extra permission. This keeps a field from becoming visible through a cheaper alternate read path. (openmetadata-service/…/ViewOperations.java, openmetadata-service/…/ColumnFieldAccess.java)
Mixed responses apply the direct entity read decision to every related reference. Lineage, activity, exports, and similar results hide a reference when it cannot be loaded or authorized. List responses can also attach per-row permissions without adding authorization fields to the serialized entity. (openmetadata-service/…/ViewPermissionFilter.java, openmetadata-service/…/PagePermissionsResolver.java)
The service first authorizes a listing as a whole, then decides whether row-level policy can change the result. When row attributes or conditional rules matter, it checks each row and fails closed on an unknown or failed decision. (openmetadata-service/…/RowDecisionGate.java)
References: openmetadata-service/…/ViewOperations.java• L11-45 openmetadata-service/…/ColumnFieldAccess.java• L41-105 openmetadata-service/…/ViewPermissionFilter.java• L25-47 openmetadata-service/…/ViewPermissionFilter.java• L127-209 openmetadata-service/…/PagePermissionsResolver.java• L18-55 openmetadata-service/…/PagePermissionsResolver.java• L68-99 openmetadata-service/…/RowDecisionGate.java• L21-58
Governance controls
Governance controls add business context to access decisions. Ownership, domains, service scope, tags, certifications, and sensitive-data classification let one policy protect a class of assets instead of one fixed entity.
Ownership and domain scope
Ownership is both a business relationship and a policy input. A user can own an asset directly or through a team. Parent metadata can contribute owners, tags, and domains to the authorization view. Domain access follows the domain hierarchy, so access to a parent domain includes its child domains while domainless assets remain available to users without a domain assignment. (openmetadata-service/…/SubjectContext.java, openmetadata-service/…/ResourceContext.java)
Domain changes are checked against the stored resource and the requested destination. A caller cannot gain permission by moving an asset out of a domain they can control. Active domain and persona selections narrow a user's view or provide work context, but they never replace roles or grant authorization. (openmetadata-service/…/RuleEvaluator.java, openmetadata-service/…/DefaultAuthorizer.java)
Service conditions apply the same governance scope to assets and the service that produced them. They can match service tags, type, environment, or name. A missing service is treated as no match, and the service itself is included when its attributes control visibility. (openmetadata-service/…/ResourceContext.java, openmetadata-service/…/RuleEvaluator.java)
References: openmetadata-service/…/SubjectContext.java• L141-221 openmetadata-service/…/ResourceContext.java• L142-164 openmetadata-service/…/ResourceContext.java• L257-378 openmetadata-service/…/RuleEvaluator.java• L169-254 openmetadata-service/…/RuleEvaluator.java• L346-472 openmetadata-service/…/DefaultAuthorizer.java• L291-321
Sensitive-data masking
PII controls protect values after normal metadata access succeeds. The PII.Sensitive classification can mask sample data, profiles, queries, test data, user email, and related change information. Administrators, bots, and permitted owners can pass the extra PII check; other callers may still see the asset with sensitive values removed. (openmetadata-service/…/PIIMasker.java, openmetadata-service/…/DefaultAuthorizer.java)
Masking follows nested field paths and ancestor tags. A single-column profile uses its ancestor path so it follows the full profile rule. Unknown or unresolved profile paths and test-case links whose source table or column no longer exists are treated as sensitive. Search hits, sort values, and aggregations use the same protection so a caller cannot recover hidden data through indexes or counts. User snapshots and email field changes are masked as well. (openmetadata-service/…/PIIMasker.java)
References: openmetadata-service/…/PIIMasker.java• L53-114 openmetadata-service/…/PIIMasker.java• L174-247 openmetadata-service/…/PIIMasker.java• L249-343 openmetadata-service/…/PIIMasker.java• L351-485 openmetadata-service/…/PIIMasker.java• L487-585 openmetadata-service/…/PIIMasker.java• L627-674 openmetadata-service/…/DefaultAuthorizer.java• L243-254
Attribution and delegated access
Writes retain the effective user and the bot that acted for that user. The actor travels with work that continues outside the request, so audit data and later authorization do not depend on request-thread state. (openmetadata-service/…/ChangeActor.java, openmetadata-service/…/PatchRequester.java)
Impersonation is a controlled bot action, not an administrator bypass. Only a bot can request a target, the target must exist and pass the impersonation policy, and the same check applies to REST and MCP calls. The request security context records a validated impersonated user, while ImpersonationContext records attribution for audit and policy conditions; MCP can set that attribution for its own bot without creating an impersonation grant. (openmetadata-service/…/JwtFilter.java, openmetadata-service/…/ImpersonationContext.java, openmetadata-service/…/DefaultAuthorizer.java)
Identity-changing endpoints remain blocked during real impersonation. The restriction uses the validated request security context rather than the attribution value, so identity operations cannot turn a temporary grant into a separate credential. A revoked bot token is checked again even when it names a target user. (openmetadata-service/…/ImpersonationRestrictionFilter.java)
High-impact actions can require a short-lived confirmation token tied to the subject, purpose, revision, and current impact. This prevents a preview for one metadata state from authorizing a later destructive action against a different state. (openmetadata-service/…/InternalActionTokenSigner.java, openmetadata-service/…/OntologyImpactService.java)
References: openmetadata-service/…/ChangeActor.java• L7-36 openmetadata-service/…/PatchRequester.java• L5-17 openmetadata-service/…/JwtFilter.java• L423-515 openmetadata-service/…/JwtFilter.java• L1051-1089 openmetadata-service/…/ImpersonationContext.java• L3-49 openmetadata-service/…/ImpersonationRestrictionFilter.java• L27-79 openmetadata-service/…/DefaultAuthorizer.java• L284-321 openmetadata-service/…/InternalActionTokenSigner.java• L26-83 openmetadata-service/…/OntologyImpactService.java• L49-135
Administration and governance operations
Security governance is managed as platform metadata. Roles, policies, domains, personas, users, and security settings are controlled resources, while permission views and dry-run login checks help administrators understand the effect of a change before it reaches live traffic.
Security configuration and candidate checks
Security settings can come from deployment configuration or stored platform settings. A reload replaces the active security setup as one controlled change and restores the prior state if dependent initialization fails. Provider, claim, key, domain, and authorization settings are validated before they become active. SAML settings also define the service-provider and identity-provider trust relationship, including endpoint, certificate, signing, encryption, and identity-claim rules. Certificate input can include rollover keys; validation needs one currently usable identity-provider certificate, while runtime settings can retain the configured key set for verification. (openmetadata-service/…/SecurityConfigurationManager.java, openmetadata-service/…/SamlSettingsHolder.java, openmetadata-service/…/SamlCertificates.java, openmetadata-service/…/SamlValidator.java)
Candidate login checks test an unsaved configuration without creating a user, issuing a platform token, starting a session, or changing live lockout state. OIDC and SAML checks use candidate provider settings, validate discovery or trust data, and stop before changing live state. Credential checks verify LDAP or Basic credentials without recording a failed attempt, then apply the same identity, role, team, domain, and account-admission rules that live login would apply. Because these checks do not change account lockout state, the server limits each credential test to one claim and rate-limits tests per administrator. (openmetadata-service/…/TestLoginRoundTrip.java, openmetadata-service/…/TestLoginCredentialHandler.java, openmetadata-service/…/TestLoginAccountChecks.java, openmetadata-service/…/TestLoginService.java)
The OIDC candidate flow performs the same authorization-code redemption and provider refresh check as live login. It resolves identity with the shared live resolvers and checks email-first account binding, interactive account state, self-signup, and registration domains without provisioning or updating the account. Results return a staged, typed failure instead of exposing provider detail as an unhandled server error. (openmetadata-service/…/TestLoginOidcHandler.java, openmetadata-service/…/TestLoginService.java, openmetadata-service/…/TestLoginAccountChecks.java)
Candidate SAML settings are built separately from live settings. The configuration check builds the same kind of sign-in request used by users, validates certificates and trust data, and uses bounded outbound checks; it does not replace the active SAML settings. Masked secrets are restored only when the candidate still points to the same trusted target. (openmetadata-service/…/SamlValidator.java, openmetadata-service/…/SamlSettingsHolder.java, openmetadata-service/…/SamlCertificates.java, openmetadata-service/…/TestLoginService.java)
References: openmetadata-service/…/SecurityConfigurationManager.java• L55-75 openmetadata-service/…/SecurityConfigurationManager.java• L107-211 openmetadata-service/…/SamlCertificates.java• L30-59 openmetadata-service/…/SamlSettingsHolder.java• L63-169 openmetadata-service/…/SamlValidator.java• L61-85 openmetadata-service/…/SamlValidator.java• L230-320 openmetadata-service/…/SamlValidator.java• L323-465 openmetadata-service/…/TestLoginRoundTrip.java• L41-55 openmetadata-service/…/TestLoginRoundTrip.java• L84-181 openmetadata-service/…/TestLoginCredentialHandler.java• L48-56 openmetadata-service/…/TestLoginCredentialHandler.java• L76-109 openmetadata-service/…/TestLoginAccountChecks.java• L32-55 openmetadata-service/…/TestLoginService.java• L43-61 openmetadata-service/…/TestLoginOidcHandler.java• L49-61 openmetadata-service/…/TestLoginOidcHandler.java• L111-151
Permission visibility and diagnostics
Permission views expose the operations a subject may perform on a resource type or entity. A user can inspect their own access, while inspection of another user is administrator-only. Related views use the same authorization contract as direct reads and hide rows whose decision cannot be proved. (openmetadata-service/…/PermissionsResource.java, openmetadata-service/…/PagePermissionsResolver.java)
Policy diagnostics explain the sources of access and the final decision. They show direct roles, inherited team roles, policies, matching rules, deny rules, and condition results using the same operation matching rules as enforcement. (openmetadata-service/…/PermissionDebugService.java)
References: openmetadata-service/…/PermissionsResource.java• L70-153 openmetadata-service/…/PermissionsResource.java• L225-365 openmetadata-service/…/PagePermissionsResolver.java• L35-55 openmetadata-service/…/PermissionDebugService.java• L47-68 openmetadata-service/…/PermissionDebugService.java• L316-407 openmetadata-service/…/PermissionDebugService.java• L410-575
Policy freshness and reference safety
Authorization caches improve response time without making policy changes permanent on one server. Policy and user-context caches have different freshness needs, and changes to users, teams, roles, policies, or personas invalidate the affected derived state across nodes. Cache generations prevent an old in-flight load from publishing after an invalidation. (openmetadata-service/…/SubjectCache.java)
Policy conditions can name tags, teams, roles, services, or bot identities. When one of those names changes, policy references are rewritten so the policy continues to describe the intended scope. Deleted references become a false condition when no valid arguments remain, and concurrent policy edits are protected by a fresh locked update. (openmetadata-service/…/PolicyConditionUpdater.java, openmetadata-service/…/RuleEvaluator.java)
References: openmetadata-service/…/SubjectCache.java• L106-154 openmetadata-service/…/SubjectCache.java• L197-286 openmetadata-service/…/SubjectCache.java• L303-349 openmetadata-service/…/PolicyConditionUpdater.java• L43-72 openmetadata-service/…/PolicyConditionUpdater.java• L83-151 openmetadata-service/…/PolicyConditionUpdater.java• L272-385 openmetadata-service/…/RuleEvaluator.java• L662-698
Change checklist
When these files or sections are changed, remember to consider these:
- Keep identity claim mapping aligned across external tokens, internally issued tokens, email verification, domain checks, session binding, and the stored identity-provider subject.
- Keep email-first subject binding aligned between live provisioning and Test Login admission. A changed provider subject needs an explicit account transfer path.
- Keep provider-token audience, issuer, and tenant checks aligned with the client and discovery configuration. A valid provider signature alone is not enough.
- Keep SAML response validation aligned with the configured issuer, audience, ACS destination, certificate set, signing, encryption, NameID, and request-correlation rules.
- Keep SAML certificate validation and runtime trust behavior aligned. Rollover input must have one current trust anchor without dropping configured runtime keys that are still needed for verification.
- Keep SAML candidate settings separate from live settings. A configuration check must not create a user, issue a token, start a session, or replace the active trust settings.
- Keep SAML and OIDC callback correlation separate from MCP callback handling. A preview or MCP callback must not create a normal web session.
- Keep the OIDC callback contract aligned with the authorization-code exchange. A provider response without a code must not be treated as a completed confidential login.
- Keep browser sign-in failures on fixed safe codes. Do not expose provider or token-exchange detail in the redirect.
- Keep MCP registration and authorization on the same redirect policy. A new native or loopback option must not bypass scheme, host, port, fragment, or length checks.
- Keep session revocation and off-boarding coverage for both active and refreshing sessions across all nodes. Also reject sessions issued by a provider that is no longer configured.
- Keep bot token regeneration aligned with signing key identity, token revocation, concurrent user edits, secret-manager values, and audit events.
- Keep stored MCP access-token checks aligned with token issuance, client deletion, explicit revocation, and token hashing.
- Keep REST and MCP impersonation aligned at the request boundary. Keep validated impersonation separate from bot attribution, and keep identity endpoints blocked for validated impersonated requests.
- Keep Basic failed-login keys tied to the stored password version, and keep one-use refresh replacement atomic with password-change sign-in termination.
- Keep Test Login credential claims and per-admin limits aligned with the fact that dry-runs do not record failed attempts. A test must not become an account lockout bypass or password oracle.
- Keep Test Login account admission aligned with live interactive-account, self-signup, registration-domain, and identity-provider-subject rules.
- Keep policy operation rules aligned between enforcement, row filtering, permission views, and policy diagnostics. In particular, do not let broad grants cover impersonation or SPARQL operations.
- Keep create-time ownership, domain, tag, and service context sourced from persisted parents rather than request stubs.
- Keep every read path's view operation aligned with the fields it returns, including column profile and custom-metric fields, related references, and list-row permission views.
- Keep PII masking aligned across nested columns, single-column and stored profiles, unresolved paths, search hits, sort values, aggregations, user data, and orphaned test data.
- Keep policy-cache invalidation and policy-reference rewrites aligned with user, team, role, policy, persona, tag, service, and bot changes.
- Keep candidate secret restoration bound to the same trusted endpoint and transport settings.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| An external token has a valid signature but the wrong audience, issuer, tenant, or email state | Another application, tenant, or an unverified account can receive platform access | ProviderTokenValidator, shared identity validation, and domain checks reject the token |
| An email-first account receives the same email with a different provider subject | A reassigned address could inherit another person's account and history | EmailFirstUserProvisioner binds the first subject and rejects conflicting subjects; Test Login performs the same check |
| An internal token is resolved with provider claim rules that do not match its minted identity | A token can resolve to the wrong account | JWTTokenGenerator shapes claims for the active resolver and JwtIdentityResolver uses the minted identity for internal tokens |
| A provider token lacks an email while sign-in is limited to allowed domains | A provider token can enter through an ambiguous legacy identity | JwtFilter requires a claimed email and checks its domain |
| A provider token resolves to a bot account | A human identity-provider login can inherit bot access | JwtFilter rejects provider tokens for bot accounts |
| An OIDC callback is accepted without an authorization code | A response that was not redeemed at the provider can complete a login | AuthenticationCodeFlowHandler and TestLoginOidcHandler require the code and redeem it before identity use |
| A SAML response is signed but expired, intended for another service provider, sent to another ACS, or missing the request binding | A captured or misrouted identity-provider response can complete the wrong login | SamlResponseValidator and the live handler check time, audience, destination, subject confirmation, and request answer |
| All configured SAML identity-provider certificates are expired or not yet valid | The service cannot validate a new SAML response | SamlCertificates.parseValidIdpCertificates requires at least one current certificate before configuration is accepted |
| A SAML runtime trust set drops a configured rollover key during settings assembly | A response signed by a still-configured rollover key can fail after a restart | SamlSettingsHolder installs the configured certificate set while configuration validation checks current usability |
| A SAML callback uses an MCP RelayState while the MCP bridge is unavailable | The callback could fall through to web login or create a web session | SamlAuthServletHandler fails closed for MCP callbacks |
| A SAML configuration check installs candidate settings or follows an unsafe server-side URL | A dry-run can alter live login behavior or probe a private target | Candidate settings are throwaway and the probe uses outbound URL policy and bounded timeouts |
| A SAML provider returns a large or hostile error page | Configuration diagnostics can leak or overload the administrator response | IdpErrorResponse extracts safe text and applies size limits |
| A bot token is revoked or changed while regeneration runs | Regeneration can re-enable a disabled bot or overwrite a newer edit | BotTokenRegenerator skips empty revoked tokens and uses current-version save checks |
| A bot token is signed by a private key that does not match the configured public key | The saved bot cannot authenticate to the platform | Regeneration verifies the generated token before saving it |
| A stored MCP access token is revoked or its client is deleted | A token could remain usable on a server that did not issue the revocation | JwtFilter requires the token hash to remain in the shared token store |
| A callback is replayed, has the wrong state, or uses an untrusted redirect | A login can attach to the wrong browser or target | Pending-session state, one-time completion data, code exchange, and trusted redirect checks bind the flow |
| An MCP redirect uses an unsafe scheme, unapproved host, loopback, or native form without the matching setting | Authorization can send a code to an unintended application | McpClientPolicy validates the scheme, host, port, and deployment options |
| An impersonation attribution value is treated as proof of an approved grant | An MCP or bot-attributed request can bypass the real impersonation boundary | JwtFilter authorizes the target and ImpersonationRestrictionFilter uses the validated security context |
A session is revoked only in ACTIVE state or its provider is changed without request-time checks | A refresh in progress or old provider session can restore access after off-boarding | SessionService revokes active and refreshing sessions and JwtFilter checks the current provider |
| A password changes while a Basic refresh request is in flight | A prior refresh token could issue a new access token after the password change | BasicAuthenticator replaces refresh tokens in one guarded operation and password changes end sign-ins |
| A Test Login password attempt is allowed to repeat without a claim or per-admin limit | The dry-run becomes an unthrottled password oracle because it does not update lockout state | TestLoginRoundTrip claims each credential test once and applies shared per-admin limits |
| A Test Login treats a bot, deleted account, or conflicting identity subject as an interactive account | An administrator can save settings that would not admit the intended user | TestLoginAccountChecks applies interactive-account and subject-binding checks before success |
| A policy condition reads a field omitted from the request projection | A rule can allow or deny from an absent attribute | ResourceContext loads authorization fields independently of response fields |
| A create request supplies a service, owner, reviewer, or domain stub | The caller can grant access with untrusted metadata | Create context uses persisted parents and applies create-specific domain and reviewer rules |
| A related entity cannot be loaded or authorized | Lineage, activity, or export data can leak a hidden reference | ViewPermissionFilter hides any reference without a clear allow |
| A column request asks for profile or custom metrics without the matching operation | Sensitive profile or test data can escape through a normal column read or search | ColumnFieldAccess removes restricted fields while retaining the allowed column data |
| A broad allow rule covers impersonation or SPARQL execution | A bot can gain a high-impact capability without a named grant | CompiledRule requires explicit allows for those operations |
| A PII asset has nested, stale, or orphaned data | Sensitive values can escape through profiles, search, counts, or test results | PIIMasker follows ancestor tags and treats unresolved profile columns, test-case columns, missing tables, and user change values as sensitive |
| A policy or team change invalidates only the writing node | Another node can use removed access until its cache expires | SubjectCache retires derived generations across nodes |
| A candidate restores a masked secret after its endpoint changes | A dry-run can send a live secret to a new target | TestLoginCandidates restores secrets only for the same trusted target |
Key files
| File | Why to read it |
|---|---|
| openmetadata-service/…/JwtFilter.java | Request identity boundary for tokens, sessions, MCP credentials, domains, and impersonation |
| openmetadata-service/…/JwtIdentityResolver.java | Shared external and internal identity resolution rules |
| openmetadata-service/…/ProviderTokenValidator.java | Provider audience, issuer, and tenant trust checks |
| openmetadata-service/…/SecurityUtil.java | Claim, email, domain, login-body, error, and redirect safety rules |
| openmetadata-service/…/AuthenticationCodeFlowHandler.java | OIDC login, callback, code exchange, session activation, refresh, and safe failure routing |
| openmetadata-service/…/EmailFirstUserProvisioner.java | Shared SSO account admission, provider-subject binding, self-signup, and account updates |
| openmetadata-service/…/SignInFailure.java | Fixed browser-facing sign-in failure contract |
| openmetadata-service/…/JWTTokenGenerator.java | Platform token claims, types, bindings, and signing identity |
| openmetadata-service/…/BotTokenRegenerator.java | Safe replacement of bot tokens after key or expiry changes |
| openmetadata-service/…/SessionService.java | Server-side login state, refresh, revocation, expiry, and off-boarding |
| openmetadata-service/…/BasicAuthenticator.java | Password login, lockout identity, password changes, and refresh-token replacement |
| openmetadata-service/…/BasicAuthServletHandler.java | Password login and session-bound token lifecycle |
| openmetadata-service/…/LdapAuthServletHandler.java | LDAP login and session-bound token lifecycle |
| openmetadata-service/…/SamlAuthServletHandler.java | SAML login correlation, response checks, browser completion, MCP separation, and session activation |
| openmetadata-service/…/SamlValidator.java | SAML configuration, certificate, endpoint, provider, and live sign-in checks |
| openmetadata-service/…/SamlCertificates.java | SAML certificate parsing, rollover input, and current-certificate validation |
| openmetadata-service/…/SamlResponseValidator.java | SAML assertion time, audience, destination, encryption, and subject-confirmation checks |
| openmetadata-service/…/SamlSettingsHolder.java | SAML trust settings, certificate set, and service-provider credential assembly |
| openmetadata-service/…/TestLoginSamlHandler.java | Candidate SAML login validation without live user or session changes |
| openmetadata-service/…/TestLoginOidcHandler.java | Candidate OIDC callback, code exchange, refresh check, and identity handoff |
| openmetadata-service/…/TestLoginRoundTrip.java | Shared candidate test session, callback ownership, and credential-test limits |
| openmetadata-service/…/TestLoginCredentialHandler.java | Candidate LDAP and Basic credential checks without lockout side effects |
| openmetadata-service/…/TestLoginAccountChecks.java | Candidate account admission and identity-provider-subject checks |
| openmetadata-service/…/TestLoginService.java | Shared live-equivalent identity, domain, role, and team resolution for dry-runs |
| openmetadata-service/…/McpClientPolicy.java | Shared MCP redirect registration and authorization boundary |
| openmetadata-service/…/ImpersonationContext.java | Difference between bot attribution and validated impersonation |
| openmetadata-service/…/ImpersonationRestrictionFilter.java | Identity endpoint restrictions during impersonation |
| openmetadata-service/…/DefaultAuthorizer.java | Common authorization entry point for resources, admins, bots, PII, and impersonation |
| openmetadata-service/…/CompiledRule.java | Allow, deny, operation scope, and policy expression behavior |
| openmetadata-service/…/RuleEvaluator.java | Governance conditions, service scope, and attribution condition validation |
| openmetadata-service/…/SubjectContext.java | User, team, ownership, domain, and inherited policy context |
| openmetadata-service/…/ResourceContext.java | Trusted resource attributes used by policy conditions |
| openmetadata-service/…/ResourceContextInterface.java | Shared resource attributes for policy evaluation, including service scope |
| openmetadata-service/…/CreateResourceContext.java | Create-time context from persisted parents and services |
| openmetadata-service/…/ViewOperations.java | Mapping between returned fields and read permissions |
| openmetadata-service/…/ColumnFieldAccess.java | Field-level access for column profiles and custom metrics |
| openmetadata-service/…/ViewPermissionFilter.java | Fail-closed filtering of mixed entity references and rows |
| openmetadata-service/…/PIIMasker.java | Sensitive-data masking across metadata, nested profiles, orphaned test links, user data, and change events |
| openmetadata-service/…/SubjectCache.java | Policy loading, team inheritance, freshness, and invalidation |
| openmetadata-service/…/PermissionDebugService.java | Explainable permission and policy evaluation results |
| openmetadata-service/…/TestLoginCandidates.java | Safe restoration of masked secrets for candidate login checks |
| openmetadata-service/…/Auth0Validator.java | Auth0 provider configuration and discovery checks |
| openmetadata-service/…/CustomOidcValidator.java | Custom OIDC discovery, key, and client checks |
| openmetadata-service/…/IdpErrorResponse.java | Bounded and safe identity-provider error text for configuration checks |