Email Federation

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up email federation by linking user domains to one shared identity provider. This setup lets workers log in to many tools with one work email address. Most teams build this link using open standards like SAML or OIDC. When teams link domains, they often map broad group roles to database accounts. Those wide roles give users far too much power once they log in. How email federation works across domains Email federation links an email domain to a central login service. When a user types

Identity Federation: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up email federation by linking user domains to one shared identity provider. This setup lets workers log in to many tools with one work email address. Most teams build this link using open standards like SAML or OIDC. When teams link domains, they often map broad group roles to database accounts. Those wide roles give users far too much power once they log in.

How email federation works across domains

Email federation links an email domain to a central login service. When a user types an email, the app checks the domain name. The app then sends the user to the right identity provider to log in. That provider checks the user password and any second factor rules. After a good check, the provider sends a signed token back to the app. The token holds the user email and group names. The app reads the token and maps those groups to local roles. Teams use this flow to join two companies or link several mail systems. Admins do not need to make new passwords for every single tool. Instead, they manage one list of users in the main directory. When someone leaves the team, admins turn off that one main account. This setup saves time and cuts down on lost password tickets.

Where native login setups fall short

Setting up domain trust solves the first step of checking who someone is. It proves the person owns that work email address at login time. It also helps admins assign a starting role in a database or cloud console. Yet this login check stops working the moment the session starts. Once a user enters a database or server, the identity provider steps back. The login tool cannot see what commands or queries the user runs next. Many teams map a federated email group to one shared admin role. That single role lets every group member read all tables or drop data. Native login logs only show that a user signed in at nine in the morning. They do not record which rows a user read or changed during the day. If a query returns sensitive emails, phone numbers, or card numbers, nothing rewrites those fields. Teams need runtime controls that check every command and mask matched fields in results.

Best practices for federated role mapping

Start by keeping your directory groups small and tied to clear job tasks. Avoid mapping a whole email domain to one wide database write role. Split read roles from write roles in your identity provider group list. Set short session times on your login tokens so users must recheck often. Review your group rules every month to remove old accounts and unused roles. Pair your login checks with tools that watch queries and commands in flight. Make sure your setup rewrites sensitive fields like national IDs in query results.

Identity Federation: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

What is the difference between single sign-on and email federation?

Single sign-on lets a user log in to many apps inside one company. Email federation links login systems across different domains or separate companies using shared trust rules.

How does domain verification work during setup?

Admins prove they own an email domain by adding a text record to DNS. The identity provider reads this record before it trusts logins from that domain.

Does federated login control what queries a developer can run?

No, federated login only checks user identity and sets an initial role at sign-in. It does not inspect or block individual SQL queries or shell commands during a session.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.