Loki SSO: why login lives in the proxy, not in Loki
A platform or security team usually needs people to sign in with their corporate identity before they can query logs, but Loki itself has no authentication layer to plug that into. The Loki documentation is direct about this: you must run an authenticating reverse proxy in front of Loki, such as nginx, HAProxy, OAuth2 Proxy or Pomerium. The proxy is where login, session checks and identity mapping happen. Loki only sees requests that have already passed that gate. Before you choose a proxy, decide where your corporate identity provider will be trusted and which team owns that configuration, because that decision shapes everything else in this integration.
Multi-tenancy is the mechanism that connects identity to data. Loki only operates as a multi-tenant system when auth_enabled is set to true, and it identifies each tenant from the X-Scope-OrgID header sent with every request. In practice, the proxy has to translate a user's group membership or role into the correct tenant value. Teams that expect Loki to read a user identity directly will be disappointed. Loki reads only the header, so the mapping table from identity groups to tenants is a design artifact you must write, review and keep under change control. Confirm with your identity team which group attributes are available from your provider and how they arrive at the proxy.
Grafana's own single sign-on is a separate login. People who query logs through Grafana sign in to Grafana, and Grafana then sends queries to Loki on their behalf. That does not secure Loki. Anyone who can reach the Loki endpoint directly, with a stolen token or from another workload, can query it without going through Grafana. Plan the two layers separately: Grafana SSO for interactive users, and the proxy gate for every API path. Confirm with your Grafana version how the data source is configured to send the tenant header, since a misconfigured data source is a common way to query the wrong tenant.
The harder part is trust. Once a request reaches Loki, the X-Scope-OrgID header is accepted as given. That means the proxy must either set the header from the authenticated identity or strip any value the client supplied before forwarding the request. If a client can send its own header and the proxy passes it through, a user can read another tenant's logs by changing one value. Test this explicitly with a request that carries a forged tenant header and confirm that the proxy overwrites or rejects it.
Every path into Loki must pass through the same gate. Log shippers that push data, the ruler that evaluates rules, and any direct API calls from scripts or automation all reach the same endpoints. If a shipper writes to Loki on an internal port that bypasses the proxy, your tenant boundary does not exist for that traffic. Inventory every client and every network route to the Loki components before go-live, then verify each one under the same authentication policy. Decide early how service accounts for shippers are issued and rotated, since they will not complete an interactive login.
Which components carry identity, tenancy and access
Loki does not authenticate users itself, so identity is carried by several components working together: a proxy that checks who is asking, a tenant header that names the partition, and every sender and reader that must agree on that header. Each component below enforces a different part of the chain, and none of them enforces the whole of it alone.
Authenticating reverse proxy
The reverse proxy in front of Loki is the only place where a user or system is checked against an identity provider. Options named in the Loki documentation include nginx, HAProxy, OAuth2 Proxy and Pomerium. It enforces who may reach the endpoint and can set or strip the tenant header. It does not decide which tenant a valid user should see, so that mapping must be defined and tested separately. Confirm that the Loki port is unreachable except through the proxy.
Identity provider connection
The identity provider connection is the trust link between the proxy and your directory or SSO service, typically through OIDC or SAML depending on the proxy chosen. It establishes who the user is and which groups they belong to. It does not know about Loki tenants, and it does not expire access on its own unless session and token lifetimes are set deliberately. Ask which groups or claims the proxy receives and how group removal takes effect.
Loki auth_enabled and tenant header
Setting auth_enabled to true turns Loki into a multi-tenant system that requires an X-Scope-OrgID header on every request. Without that setting, all data sits in one implicit tenant and the header is not used. The setting does not authenticate anyone, so an unauthenticated caller who sets any tenant value can still reach that tenant's data unless the proxy blocks direct access. Check that clients cannot supply the header unless the proxy has validated it.
Grafana data source tenant header
Grafana's Loki data source must send the same X-Scope-OrgID value for each user or team, usually through a custom HTTP header configured on the data source. Grafana can be set up with its own SSO so people sign in to Grafana, but Grafana then holds a single data source configuration unless you provision separate ones. Confirm how query access is split by team, because a shared data source sending one tenant value exposes that tenant to every Grafana user who can open it.
Log shippers that must send tenant identity
Grafana Alloy, Fluent Bit, Fluentd, the Docker logging driver and OpenTelemetry over HTTP each need explicit configuration to send the tenant identity on writes. Loki's send-data documentation covers each shipper. Shippers enforce nothing on the read side, and a missing or wrong tenant value typically sends logs to the wrong tenant or fails the write. Promtail reached end of life on March 2, 2026, so new shipper work should target Alloy. Test each source with a known tenant before rollout.
Grafana Enterprise Logs token and label access control
Grafana Enterprise Logs adds token authorization and label-based access control, which can limit what a user or team may query inside a tenant by label. This is the commercial alternative to relying only on proxy-level tenant separation. Open-source Loki does not provide these controls, so label-level restrictions in AGPLv3 Loki must be handled through proxy rules or separate tenants. Ask Grafana Labs to confirm current feature scope and licensing before choosing an edition.
Which proxy, tenant model and Grafana login fit your organization
This table compares the proxy options, tenant models, Grafana login approaches and Loki editions that shape an SSO integration. Read each row for when the option fits and what it asks your team to run after go-live. The main takeaway is that the proxy choice matters less than who owns group-to-tenant mapping and isolation logic over the life of the stack.
| Decision | Option | When it fits | Ongoing operational cost |
|---|---|---|---|
| Authenticating proxy | nginx or HAProxy with an auth subrequest to your IdP or token service | Your platform team already runs nginx or HAProxy and wants one ingress standard | You write and test the auth subrequest logic, map identity claims to X-Scope-OrgID, and patch the proxy on your own schedule |
| Authenticating proxy | OAuth2 Proxy | You want OIDC or OAuth2 login in front of Loki with a maintained, purpose-built component | You operate another service, track its releases, and confirm how group claims reach the tenant header |
| Authenticating proxy | Pomerium | You want identity-aware access policies per route and a single policy layer for several internal tools | You own policy definitions as code, keep them reviewed, and confirm the features your edition provides before you commit |
| Tenant model | One tenant per team | Teams have separate ownership and few cross-team investigations | Each new team needs a tenant, a group mapping and a retention rule, so onboarding work recurs |
| Tenant model | One tenant per environment | Production and non-production must be queried and retained separately | Cross-environment incident work needs a second query path or a broader role, which the proxy must enforce |
| Tenant model | One tenant per data classification | Logs holding regulated or personal data need stricter retention and narrower access | Your team must build and test isolation yourself with open-source Loki, and logs with mixed classes must be split at ingestion |
| Grafana login | Grafana SSO through the same IdP | Users already sign in to the IdP, and you want one identity lifecycle for joiners and leavers | Group sync logic in Grafana must match the proxy's tenant mapping, so changes in one place can drift from the other |
| Grafana login | Separate Grafana accounts | Few users query logs and you accept local account management for them | Passwords, reviews and offboarding run outside the IdP, which adds audit work for each Grafana account |
| Loki edition | Open-source Loki (AGPLv3) with your own proxy | You want no commercial license and can own access control at the proxy layer | Tenant isolation, token handling and audit of who queried which tenant are your team's responsibility |
| Loki edition | Grafana Enterprise Logs | You need token authorization, label-based access control or cross-tenant queries built into the product | Commercial licensing and a support contract apply, and you should confirm current terms and the long-term support dates with Grafana Labs |
How X-Scope-OrgID mapping works and where it can be spoofed
The tenant decision happens in the authenticating proxy, so that is where you design and test the control. When a user signs in through the proxy, the proxy reads the user's groups or claims from the identity provider's token, looks each one up in your mapping table, and sets the X-Scope-OrgID header to the tenant that the mapping returns before forwarding the request to Loki. Loki runs in multi-tenant mode when auth_enabled is true, and it uses that header on every request to choose which tenant's data to read or write. Grafana data sources must send the same header, either through a proxy route or a configured custom header. Confirm exactly how your chosen proxy (nginx, HAProxy, OAuth2 Proxy or Pomerium) exposes groups or claims to its configuration, because that determines how the lookup is written.
The proxy must overwrite or strip any X-Scope-OrgID value the client sends. Loki reads the header as given, so a user who adds their own value to a request can ask for another team's tenant if the proxy passes it through untouched. The proxy should remove the inbound header on every route, including the push endpoint, the query endpoints and any ruler or administrative paths, and then set its own value from the mapping. Network design matters as well: Loki's listening ports should accept traffic only from the proxy, so a client cannot skip the proxy and send the header directly. Test this before go-live. Send requests with a forged header for a tenant the test user is not mapped to, and confirm that the request is refused or returns only the mapped tenant's data. Repeat the test on each route.
A user who belongs to several teams needs a written rule, because the proxy must return one header value or a defined set. The first option is a single home tenant per user, chosen by a stated rule such as primary team or the team that owns the service the person supports. This keeps each query on one tenant and makes audit records easy to read. The second option is multi-tenant querying, where the proxy sends several tenants for one query. Loki supports querying multiple tenants, but the header syntax, the limits that apply and the behavior of each query path depend on the version you run, so confirm them in the Loki multi-tenancy documentation for your release before you adopt the approach. Grafana Enterprise Logs adds cross-tenant queries and label-based access control, which is a separate decision covered in the editions topic.
Loki does not check who the user is. It has no built-in authentication layer, and its documentation directs you to place an authenticating reverse proxy in front of it. Its tenant handling separates stored data by the tenant string in the header, and it accepts that string from whoever sends the request. Authorization therefore lives in the proxy, the mapping table and the network path to Loki, and each of them needs an owner. The mapping table is a control you own. Any change in team membership, offboarding or identity provider group must be reflected in it, or the former team's access continues. Set a review schedule for the table, assign the reviewer, and tie reviews to your joiner, mover and leaver process. Ask the identity team which group changes they can export so the review can compare the table with current membership.
Build sequence: from identity provider to a tested tenant boundary
This sequence turns an identity provider and group model into a Loki deployment where every request is authenticated, every tenant is mapped from a verified group, and every user sees only the streams their group owns. Each step ends with a check so the boundary is proven before the next layer is added.
Confirm the identity provider and group model
The platform team and the identity team agree on which identity provider issues tokens, which claim or group attribute carries team membership, and how groups map to log tenants. Write down one tenant name per team, the groups allowed to read each tenant, and whether any group needs cross-tenant access. Loki has no login of its own, so this decision sets the rest of the build. The step is done when the mapping is written, reviewed by the owners of each team's logs, and the identity provider can show a test user's group claims for a sample account.
Enable multi-tenancy in Loki
Set auth_enabled to true in the Loki configuration on every component that serves or receives requests, then confirm that Loki identifies tenants from the X-Scope-OrgID header. Keep Loki on a private network address so nothing outside the proxy can reach it directly. Without the proxy in place at this point, Loki will accept any tenant header, so this step is only complete when the next step is ready to follow immediately. The check is a test push and query with a header set to a test tenant, which should succeed only when the header is present, and a request with no header, which should be refused.
Deploy the authenticating proxy in front of every endpoint
Place an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium in front of Loki, and route every endpoint through it, including the write path used by shippers and the read path used by Grafana and API clients. Check each endpoint your Loki version exposes for the deployment mode you chose, because a missed path leaves an unauthenticated route open. The proxy validates the user or service identity against the identity provider. The step is done when an unauthenticated request to each endpoint is refused and an authenticated request with a valid session or token is accepted.
Map groups to tenants and strip client tenant headers
Configure the proxy to read the verified group claim and set X-Scope-OrgID to the single tenant that group owns, using the mapping from the first step. The proxy must remove any X-Scope-OrgID header sent by the client before setting its own value, so a caller cannot choose a tenant. Users in several groups need an explicit rule, and cross-tenant reads should go only to a named role. The closing check has three parts: an unauthenticated request is refused, a user in one group cannot read another tenant's streams, and a request carrying a forged X-Scope-OrgID header is overwritten with the tenant the proxy assigns.
Configure shippers to send tenant identity
Update each log shipper to authenticate to the proxy and to set the tenant for the data it sends. Grafana Alloy is the supported shipper for Loki, and Fluent Bit, Fluentd, the Docker logging driver and OpenTelemetry over HTTP are other supported paths. Each agent needs a credential for its own service identity and a tenant assignment that matches the owning team. Promtail has reached end of life, so any Promtail configuration in the estate should be migrated as part of this step. The check is that a test event from each shipper lands in the expected tenant and cannot be read by a user from another group.
Set Grafana data sources and Grafana SSO
Configure Grafana to sign users in through the same identity provider, so that the group claims are available to Grafana's role mapping. Create one Loki data source per tenant or per access group, with the tenant header set to the matching value and the request routed through the proxy. Users should reach logs only through data sources their groups are allowed to use. Confirm the Grafana side by signing in as test users from two groups, checking that each user sees only their data sources, and that a query through one data source returns no streams from the other tenant.
Run the closing boundary test and record the evidence
Repeat the three core checks against the full path: a shipper, the proxy, Loki storage, and Grafana, using test accounts from at least two groups and a service identity. Test the unauthenticated request, the cross-tenant read, the forged header, and a token or session that has expired or been revoked. Record the results, the configuration versions, and the reviewer for the change. The step is done when every check passes on the production-like environment and the results are stored with the configuration. Ask the auditor or internal control owner which evidence they require before the test starts, because compliance readiness depends on that record, and DeployOpen prepares the evidence but does not issue assessments.
What drives the effort and cost of Loki identity work
This table lists the factors that change how much identity work a Loki deployment needs and shows how to keep each one contained. Read each row as a lever: the cost of identity work usually grows with the number of identity sources, tenants, write paths, environments and Grafana instances, so agreeing those choices early matters more than tuning any single component. The main takeaway is that a single tenant model, one proxy entry point and automated group sync keep the work bounded.
| Driver | Why it changes effort or cost | How to keep it down |
|---|---|---|
| Identity providers and group models | Each provider brings its own claims, group names and token lifetimes that the proxy must map to tenants. | Pick one identity provider as the source of truth for people and agree the group model before build. |
| Number of tenants | Every tenant needs its own X-Scope-OrgID mapping, access rules and retention decisions, and each new team adds review work. | Agree one tenant model before build, such as per environment or per business unit, and document the onboarding steps. |
| Tenant changes over time | Frequent team reorganizations trigger repeated mapping edits and access reviews. | Drive tenant membership from identity groups with automated group sync rather than manual proxy edits. |
| Log shippers and write paths | Every shipper, agent and direct HTTP writer must send the tenant header, and each path needs its own test. | Standardize on Grafana Alloy or another single shipper pattern, and confirm which write paths can set the header. |
| Environments (dev, test, production) | Each environment usually needs its own proxy configuration, identity client registration and tenant mapping. | Keep one configuration template parameterized by environment, and test the identity flow in lower environments first. |
| Grafana instances | Each Grafana instance needs its own SSO configuration, data source setup and role mapping to tenants. | Consolidate onto as few Grafana instances as the organization allows, and script the SSO and data source settings. |
| Audit trail requirements for access | Assessors may ask who queried which tenant and when, which needs logs of the proxy and identity events kept under retention controls. | Confirm the audit evidence expected by your compliance scope early, then set proxy and identity log retention and access before go-live. |
How the setup differs on a single VM, Kubernetes and air-gapped networks
On a single virtual machine or with a monolithic deployment, Loki runs as one process and the authenticating proxy sits in front of it on the same host or within the same network segment. Because there is only one Loki process, there are no internal service-to-service calls to authenticate, and the main question is whether the proxy and Loki share a trust boundary you are willing to accept. Loki's monolithic mode is documented for workloads up to about 20 GB of logs per day, so this layout suits smaller estates and labs.
What to set up on this layout:
- One entry point: expose only the proxy's listener and block direct access to Loki's HTTP port from the network.
- Tenant header handling: the proxy should set or overwrite X-Scope-OrgID from the verified identity, and strip any client-supplied value.
- Local identity source: decide whether the proxy reads users from a local file, a directory service or an OIDC provider, and document who can change it.
- Host hardening: Loki's data directory, object store credentials and proxy secrets share one host, so restrict file permissions and access to the operating system account.
- Upgrade path: plan how a single-process deployment moves to a larger mode if daily volume grows.
Confirm the monolithic volume guidance against the current Loki documentation for your version before you commit to this layout.
On Kubernetes, the simple scalable and microservices modes split Loki into separate read and write paths, and the authenticating proxy usually becomes an ingress in front of the read and write endpoints. Traffic from agents on the write path and from Grafana on the read path should be authenticated separately, because they have different callers and different rate profiles. Internal calls between Loki components are a second surface: a compromised pod on the cluster network could reach component endpoints unless you restrict them.
What to design for on Kubernetes:
- Separate routes: define distinct ingress rules for push and query, with separate credentials or identities for each.
- Internal traffic: use network policies to limit which pods can reach Loki components, and enable TLS between components where your configuration supports it.
- Tenant mapping: keep X-Scope-OrgID assignment in the proxy so that no workload can choose its own tenant.
- Identity for Grafana: configure Grafana's own SSO for people, and treat machine clients such as log shippers as separate identities.
- Mode decision: Loki's documentation states that simple scalable mode is being deprecated and will be removed with the Loki 4.0 release, so confirm whether microservices mode or another supported layout fits your plan before building routes around the simple scalable targets.
Review the chart version and the internal service list for your release before writing network policies.
On an air-gapped network, there is often no reachable external identity provider, so user and token handling moves inside the enclosure. Common choices are a local directory such as LDAP-style sources, a local user file held by the proxy, or certificates issued by an internal certificate authority for machine clients. Every component, including container images, Loki packages, proxy binaries and identity data, must be imported through an approved transfer process, and updates follow the same path.
What to plan for an air-gapped build:
- Directory source: confirm which LDAP-style or local directory the proxy can read without outbound calls, and how group membership maps to tenants.
- Offline tokens and certificates: plan how tokens are issued, rotated and revoked without a cloud service, and how certificate revocation is checked when there is no external OCSP or CRL access.
- Object storage: use an on-premises store that supports the access controls Loki needs, since the documentation does not recommend the local filesystem or most S3-compatible stores for production.
- Update channel: budget for offline transfer of Loki and proxy releases, including security fixes.
- Vendor confirmation: ask the proxy vendor whether its authentication features work fully offline, including license checks, token signing, metadata fetches and any telemetry.
Do not assume offline support until the proxy vendor confirms it in writing for your version.
Securing the login path, tenant headers and secrets
In open-source Loki, the security boundary sits in the reverse proxy, not in Loki itself. The cards below cover what the proxy must enforce, how identity provider secrets and session keys are handled, and what remains the responsibility of your team. Object storage and retention controls are covered in the separate Loki security hardening topic.
Authenticate every Loki endpoint
Loki has no built-in authentication layer, so the authenticating proxy must sit in front of every route, including the push API used by log shippers, the query API used by Grafana, and the ruler and admin endpoints. Inventory each path your deployment exposes and confirm that none bypasses the proxy, including internal service addresses reachable from other networks. Test unauthenticated requests against each path before go-live.
Strip client-supplied tenant headers
Loki identifies tenants through the X-Scope-OrgID header, so a client that can set this header can read or write another tenant's logs. The proxy should overwrite or remove any tenant header sent by the caller and set it only from the identity it has verified. Confirm the behavior with a test request that sends a foreign tenant ID while authenticated as a different user.
Map groups to tenants with least privilege
Map each identity provider group to the smallest set of tenants and access modes it needs, such as read-only access to one application's logs. Avoid mapping broad administrator groups to every tenant, and review mappings whenever teams change. Document who approves a mapping change and keep the group-to-tenant table under version control so audits can trace who had access to which logs and when.
Protect IdP client secrets and session keys
The proxy holds the OIDC client secret, the cookie signing or encryption key and, in some setups, a session store credential. Keep these in a secrets manager or restricted file with owner-only permissions, rotate them on a defined schedule, and never place them in container images or shared configuration repositories. Confirm which secrets your chosen proxy requires and who can read them in production.
Encrypt traffic between proxy and Loki
Requests carrying tenant identity travel from the proxy to Loki, so that hop should use TLS, with certificate validation enabled in every client that connects. Check the Loki and proxy documentation for the TLS settings each component supports, and confirm how certificates are issued and renewed. Decide whether internal traffic may cross any shared network segment, and encrypt it if so.
Log authentication and tenant decisions
Record login successes and failures, group claims received, tenant headers assigned and denied requests at the proxy, and forward these records to a store your security team can search. Without these events, a misconfigured mapping or a header bypass may go unnoticed. Confirm retention for authentication logs with your compliance owner, since these records may themselves contain personal data.
Accept that the proxy enforces tenancy
In open-source Loki, tenant isolation depends on the proxy: Loki trusts the X-Scope-OrgID value it receives and does not check the caller's identity. Any proxy misconfiguration, direct access to Loki or header leak becomes a cross-tenant exposure. Treat the proxy as a security-critical component, test it as one, and do not treat multi-tenancy as an isolation control on its own without network restrictions that force traffic through the proxy.
How to test that tenant isolation holds and fails safely
Before any team sends production logs through the proxy, run a fixed set of tests that try to break tenant isolation and confirm that every failure closes rather than opens. The first test is the most basic: send push and query requests to every Loki path, including the write endpoint and the query endpoints used by Grafana and any direct API clients, with no credentials at all and with an expired or malformed token. Each request should be refused by the reverse proxy before it reaches Loki. Because Loki has no authentication layer of its own, the proxy configuration is the only thing standing between an anonymous caller and the data, so the test should be written to enumerate paths from the proxy's routing rules rather than from memory. Keep the results as evidence for your access control review.
The second group of tests checks that a user in one group cannot see another tenant's streams. Create at least two test users mapped to two different tenants, ingest a known marker log line into each tenant, and then query from each identity for both markers. Each user should see only their own marker and never the other one, including through label-only queries that match on broad selectors such as a common application label. Repeat the check from the Grafana side using the same identities, because a Grafana data source configured with a fixed organization identifier can silently bypass the mapping you intended. The reader should confirm how their chosen proxy sets the tenant header and whether any route permits a caller to choose a tenant by path or query parameter.
Next, test the header itself. Send a request from an authenticated test user that includes a client-supplied X-Scope-OrgID for another tenant, and confirm that the proxy overwrites or strips the value so Loki only receives the tenant derived from the identity. Run the same test on the push path, where a misconfigured shipper could otherwise write logs into another tenant's space. Then test session behavior: an expired session should stop working on the next request without a manual logout, and removing a user from the identity provider group that grants access should block access within the time window your configuration allows. Record that window explicitly, since it is the period during which a departed employee can still read logs. Finally, test failure behavior. Make the identity provider unreachable, for example by blocking its network path from the proxy in a test environment, and confirm that the proxy refuses requests rather than passing them through unauthenticated. Also confirm that Grafana logins map to the expected data sources and that users without a mapping see no data source at all.
These tests are not a one-time gate. Repeat the full set after every upgrade of the reverse proxy, Loki, or Grafana, and after any change to proxy routing, header handling, identity provider group rules, or the Helm values that control authentication. Upgrades often change default header behavior, route names, or session handling in ways that open a path nobody tested, and the Loki upgrade notes should be reviewed for any change to multi-tenancy or authentication behavior. Keep the test cases as scripts in version control with recorded expected results so a reviewer can rerun them and compare outputs. Ask your implementation partner, or your own team, to state in writing which test cases are covered by the engagement, who runs them after each change, and where the results are stored.
Questions teams ask before building Loki SSO
Can Loki authenticate users on its own without a proxy?
No. Loki has no built-in authentication layer, and its documentation says you must run an authenticating reverse proxy in front of it, such as nginx, HAProxy, OAuth2 Proxy or Pomerium. The proxy handles login with your identity provider and decides who may reach Loki. Loki identifies tenants through the X-Scope-OrgID header on every request once auth_enabled is true, so the proxy must set or enforce that header based on the user's group, and clients must not be able to set it themselves. Every path to Loki's HTTP endpoints needs the same protection, including ingestion and service-to-service calls, because one open port undoes the design. Grafana's SSO covers people who query through Grafana, but it does not protect the Loki API for other callers. Confirm the exact proxy settings against the authentication documentation for your Loki version before you finalize the design.
What drives the cost of building Loki SSO?
The main cost is engineering time to design and build the identity path, then test and cut over. The components are identity provider configuration, the proxy with its TLS and ingress, group-to-tenant mapping, Grafana SSO wiring, verification testing and handover documentation. One-time work covers design, build, testing and cutover. Recurring costs come from keeping the proxy and identity configuration current with Loki upgrades, certificate renewal, changes to groups and tenants, and periodic access reviews. Costs rise with the number of identity sources, tenants, custom group rules and proxy paths that need protection. DeployOpen does not publish a price list, and a quote follows from a written scope. Ask for line items for design, build, testing, handover and any retainer, and confirm what the retainer covers for upgrades and identity changes.
What decides how long a Loki SSO build takes?
Duration depends mainly on how many identity sources, groups and tenants you have, and on how quickly your identity team can register applications and approve configuration. Certificate requests, DNS changes, network access and change windows often set the pace more than the Loki configuration itself. Verification takes longer when access must be proven for every route, not just the login page. Engagements are fixed-scope, so the timeline is agreed in writing before work starts and tied to specific deliverables. Ask for the dependencies that could stall the work: identity provider approvals, DNS and certificate requests, change windows, and access to a non-production Loki environment for testing. No duration is given here because it depends on those inputs. When you receive a proposed timeline, check which of your teams it assumes will act, and when.
Can an internal team build Loki SSO without outside help?
Yes, a team that already runs reverse proxies and manages its identity provider can build this, provided it covers the full access path and tests it. The skills needed are proxy configuration, OpenID Connect or SAML setup on the identity side, Loki's tenant model with the X-Scope-OrgID header, Grafana data source configuration and TLS. The common failure is rarely the login flow. It is usually a missed route, such as an ingestion endpoint, a health or metrics path, or a direct port that accepts requests without the proxy. Teams without someone who has tested this kind of configuration often find these gaps late. Internal teams should also plan for ongoing ownership, since Loki upgrades and identity changes require re-testing. A useful check is whether one engineer can state, for every Loki endpoint, which identity is required and where the tenant header comes from.
What does Loki SSO need from our identity and platform teams?
The work needs access and decisions from several teams before the build starts. Identity teams must provide an administrator who can register the Loki and Grafana applications, supply client settings, and confirm which claims or groups the token carries. You need a group model: a list of groups, their members, and which group maps to which tenant or read permission. Tenant decisions cover how many tenants you need, whether teams share one, and who owns each tenant. Platform teams provide DNS names, TLS certificates, ingress or load balancer access and a non-production Loki environment. Test users are named accounts in each group, including at least one account that should be denied, so access can be verified before cutover. Security should approve the exposure path and review test results. Ask for these inputs to be listed in the written scope so gaps appear early.
When does Grafana Enterprise Logs change the SSO decision?
Grafana Enterprise Logs changes the decision when you need access control inside a tenant, not only separation between tenants. GEL is Grafana Labs' commercial product based on Loki, and its documentation describes token authorization, label-based access control and cross-tenant queries. If one team must see only some streams within a shared tenant, the open-source path needs extra proxy logic or more tenants, which makes the design harder to maintain. If each team can have its own tenant, the proxy approach may be enough. GEL entered long-term support with version 3.6 and reaches end of life on February 1, 2029, which matters for planning. Ask Grafana Labs about licensing, and compare that cost with the engineering effort the proxy logic would require.
Which log shipper should we use with a Loki SSO setup?
Use Grafana Alloy. Promtail reached end of life on March 2, 2026, with no further updates or commercial support, and Grafana directs Promtail users to migrate to Alloy. Alloy, a vendor-neutral distribution of the OpenTelemetry Collector, is Grafana's supported log shipper for Loki. For SSO, the shipper matters because it must send logs to the correct tenant through the proxy, using headers or credentials the proxy accepts. Check that the shipper sets X-Scope-OrgID consistently, that it reaches the proxy endpoint rather than Loki directly, and that any per-tenant credentials are issued and rotated under your control. Loki also accepts OpenTelemetry logs over HTTP, along with Fluent Bit, Fluentd and the Docker logging driver, so confirm which of these your hosts run before writing the tenant mapping.
What usually breaks in a Loki SSO setup after launch?
Most failures sit in routes, headers and group mappings, and fewer in the login screen itself. The usual problems are a Loki endpoint reachable without the proxy, a client that sends its own X-Scope-OrgID header that the proxy does not overwrite, a Grafana data source configured for a tenant that does not match the user's group, group claims that change in the identity provider without a matching update, and token expiry that interrupts long-running dashboards or alerts. Retention can also surprise teams. Loki retention is disabled by default, so logs are kept until retention is enabled, and that control is separate from access. Test each case with named users, including a denied user, and repeat the tests after every Loki upgrade or identity change.
What to monitor, document and review after Loki SSO goes live
The first thing to watch after go-live is the authentication boundary, because Loki trusts whatever tenant the proxy sends in X-Scope-OrgID. Track proxy authentication failures, IdP outages and token validation errors, and alert on sudden spikes in 401 or 403 responses from the proxy. Decide in advance what happens to queries when the identity provider is unreachable: whether existing sessions keep working, and whether Grafana users see a clear login error. Confirm with your IdP and proxy vendor how session lifetimes and cookie settings behave during an outage, since those settings decide how far the failure spreads.
Group-to-tenant mappings change more often than anything else in this stack. Every new team, reorganization or contractor group can add or widen access, so each mapping change should go through a named approver, a ticket, and a peer review of the rule before it reaches production. Treat a wildcard or broad group match as a higher-risk change that needs a second approver. Record who can edit the mapping source and confirm that the change history is kept. Review the mapping list on a fixed cadence with the data owner of each tenant, and remove mappings whose groups no longer exist in the directory.
Stale accounts and secrets are where access quietly outlives its purpose. Schedule a review of users who have not signed in within a period your security policy sets, and disable accounts when the directory disables them, confirming that deprovisioning also ends existing proxy and Grafana sessions. Track the lifetime of the OIDC or SAML client secret, the proxy's TLS certificates, the signing keys and any Grafana service account tokens. Rotation should be rehearsed in a non-production environment first, with a plan for the overlap window during which both old and new credentials are valid.
Documentation should let someone who was not present at build time run the system safely. Keep these records current: the tenant model, showing which teams or products map to which tenant IDs and who owns each one; the mapping source and its owner; the header-handling rules, listing which headers the proxy strips from client requests, sets and forwards, and how it prevents clients from supplying their own X-Scope-OrgID; the test cases with their most recent results and dates; and a runbook for revoking a user's or group's access across the proxy, Grafana and the IdP. Test the revocation runbook at least once before anyone needs it.
Upgrades need separate checks for each component. The authenticating proxy, Loki and Grafana change behavior on their own release schedules, and a passing Loki upgrade does not prove the proxy still forwards the tenant header correctly. Promtail reached end of life on March 2, 2026, with no further updates or commercial support, and Grafana directs users to Grafana Alloy. If a shipper change is part of your plan, test the new tenant header path end to end, confirming that logs from each tenant land only in that tenant and that a query from a different tenant returns nothing.
How DeployOpen works on this
DeployOpen plans, builds, documents and supports Loki SSO and identity integration inside your own infrastructure, using open-source components you control. Engagements are fixed-scope, with the scope, deliverables and timeline agreed in writing before work begins.
How we scope
- Inventory which people, service accounts and automation need to query logs and which teams they belong to
- Confirm the identity provider, its protocol support and how group membership is exposed to the proxy
- Agree the tenant model, mapping each team or customer to a unique X-Scope-OrgID value in writing
- Record the Grafana access model and whether Grafana SSO or the proxy will carry user identity
How we build
- Place an authenticating reverse proxy such as OAuth2 Proxy, Pomerium, nginx or HAProxy in front of every Loki endpoint
- Configure the proxy to set or strip X-Scope-OrgID so clients cannot choose tenants they are not assigned
- Wire Grafana SSO for query users and test the login, group mapping and logout paths end to end
- Test that cross-tenant reads fail, and that writes and direct component access bypassing the proxy are blocked
How we hand over
- Deliver the written configuration, group-to-tenant mapping table and proxy and Grafana settings as versioned files
- Document how to add a user, move a team between tenants and rotate client secrets or signing keys
- Walk your operations and security staff through the test results, including the cross-tenant denial checks
- Record known limits, such as any tenant isolation your chosen components do not provide, for your risk review
How we support
- Offer ongoing support and upgrades as a retainer after handover, covering proxy and Grafana identity changes
- Re-run tenant isolation tests after Loki, proxy or identity provider upgrades before they reach production
- Review access logs and mapping drift with your team on an agreed cadence
- Confirm the retainer scope, response expectations and exclusions in writing before it starts

