How to Configure Azure Well Known Openid Configuration
The azure well known openid configuration document tells apps how to check user log in tokens. You set it up by pointing your app to the public metadata URL for your tenant. This public JSON file lists the login URLs, token endpoints, and public signing keys. Your app reads this file to trust user tokens without hardcoding secret keys in code. Using this standard document keeps your login flow stable when Microsoft rotates signing keys. How the azure well known openid configuration works Eve
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.
The azure well known openid configuration document tells apps how to check user log in tokens. You set it up by pointing your app to the public metadata URL for your tenant.
This public JSON file lists the login URLs, token endpoints, and public signing keys. Your app reads this file to trust user tokens without hardcoding secret keys in code. Using this standard document keeps your login flow stable when Microsoft rotates signing keys.
How the azure well known openid configuration works
Every cloud tenant publishes a public discovery file at a standard web path. When a user logs in, your app fetches this document first. The document shows where to send the user and how to check their token.
This setup affects human users, web apps, APIs, and background services. Each workload reads the same metadata to check who sent a request. If you run a single-tenant app, point it to your exact tenant ID URL. Avoid the common multi-tenant URL unless you build software for outside companies.
Safe defaults start with strict issuer checks inside your app code. Tell your token library to match the exact issuer string from the discovery file. Require the audience claim to match your specific app registration ID. Always fetch the signing keys over HTTPS and cache them for a few hours. Caching prevents slow startups and allows your app to pick up key rotations.
Setting up safe token checks for workloads
Start by registering your app in your cloud directory. Note your tenant ID and your unique client ID from the overview page. Give your app only the minimum directory permissions it needs to run.
Configure your app security library with the discovery URL for your tenant. Most modern web frameworks fetch the public keys from the linked key URI by default. Never disable signature checks or expiration checks during local testing. A test flag left in production lets anyone forge a login token.
Azure RBAC + OpenID Connect (OIDC): architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Check whether your app uses the version one or version two endpoint. Version two adds standard scopes and cleaner claims for modern apps. Pick one version across your team so token claims look the same everywhere. Test the setup by logging in with a test account and reading the decoded token.
Auditing and limits of static login setups
Setting up discovery metadata only solves the initial login handshake. Once a user or service gets a valid token, static config stops helping. The token stays valid until it expires, even if the user changes roles.
To audit access well, review your sign-in logs in the cloud portal every week. Check which apps request tokens and watch for failed signature alerts. Verify that every internal API checks the audience claim before returning data.
Keep in mind that identity metadata cannot see what happens inside a session. A valid token proves who logged in at the start of a request. It does not control which database queries run or which sensitive records return. For deeper safety, pair strong login checks with controls over live data queries.
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
Is the OpenID discovery URL safe to expose in public code?
Yes, the discovery URL and its contents are public by design. It only shares public signing keys and endpoints, never private keys or secrets.
Why did my app reject tokens after a few weeks?
Your app likely hardcoded a public signing key instead of using the discovery URL. Cloud providers rotate signing keys often, so apps must fetch the key list on a schedule.
Should I use the common endpoint or my tenant ID?
Use your specific tenant ID for all internal company apps and tools. The common endpoint allows any Microsoft account to attempt a login, which risks unauthorized access.
Related guides
In this post