The Simplest Way to Make Jetty and Microsoft Entra ID Work Like They Should
Teams pair Jetty and Microsoft Entra ID to run Java web apps with central login rules. This setup lets users sign in once and reach internal tools based on their group roles. Jetty serves web apps and APIs with a small footprint. Microsoft Entra ID stores user accounts, groups, and login rules for the whole company. Linking them removes the need for local user lists on each web server. Instead, the identity provider checks who the user is before the app loads. How logins flow between Jetty an
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Teams pair Jetty and Microsoft Entra ID to run Java web apps with central login rules. This setup lets users sign in once and reach internal tools based on their group roles.
Jetty serves web apps and APIs with a small footprint. Microsoft Entra ID stores user accounts, groups, and login rules for the whole company. Linking them removes the need for local user lists on each web server. Instead, the identity provider checks who the user is before the app loads.
How logins flow between Jetty and Microsoft Entra ID
A user opens a browser and visits a web app running on Jetty. The server sees no active session and sends the browser to the Microsoft login page. The user enters their email, password, and second factor code. Microsoft Entra ID checks these details against company policies and device rules.
After a valid login, the identity system builds a signed token for that user. This token holds the user ID, email, and group role names. The browser sends this token back to the Jetty web server. The server checks the digital signature using public keys from Microsoft.
Once the signature passes, the web app reads the group claims inside the token. It matches those claims to local app roles like viewer, editor, or admin. The user can now view pages and run tasks that match their assigned role. When the token expires, the server asks the identity provider for a fresh check.
Common failure modes and role scoping
Many teams make mistakes when they first link their web servers and identity systems. A common trap is using a single shared service account for backend API calls. When every server uses one account, audit logs cannot show which person ran a task. If an attacker steals that shared key, they gain wide reach across the network.
Broad tokens cause another major risk for production systems. Teams often put every group claim into one token, or set long token lifetimes. If a user leaves a project, an old token might still let them into the app. Long token life also gives attackers more time to replay stolen sessions.
Microsoft Entra ID (Azure AD) + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged actions inside the web app create blind spots during security reviews. The login system records the first sign-in, but misses what the user does next. You need clear logs that tie each web request and data query to one user email.
To fix these issues, scope roles down to the smallest needed set. Create specific app roles in Microsoft Entra ID for each Jetty service. Assign users to those narrow roles instead of broad company groups. Keep token lifetimes short so the web server checks user status often. Restrict network paths so only trusted load balancers can send traffic to the web server ports. Also, mask sensitive data like emails, phone numbers, card numbers, and national IDs in app results.
Managing secrets and server maintenance
Linking a web server directly to an identity provider requires local client secrets. Engineers must place these secrets in server files and rotate them before they expire. If a secret expires on a weekend, nobody can log in to the web app. Managing these files across dozens of servers takes a lot of team time.
Teams also struggle to update security libraries inside older Java apps. Every time the login protocol changes, developers must rebuild and redeploy the web server code. Separating login checks from the app code makes server updates much faster and safer.
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
How does Jetty check tokens from Microsoft Entra ID?
The web server downloads public signing keys from the Microsoft identity endpoint. It uses these keys to check the token signature and confirm the expiration time.
How should teams map Microsoft Entra ID groups to web app roles?
Admins define specific app roles inside the enterprise app registration page. The identity system sends these role names in the token for the web server to read.
What happens when a user loses their role in Microsoft Entra ID?
The identity system stops issuing new tokens for that user right away. When the current short session ends, the web server blocks the user from running new tasks.
Related guides
In this post