Authorization server metadata
A client that only wants access tokens still needs a dozen facts about the authorization server: where its endpoints are, which grants and authenticationChecking evidence that someone, or some application, controls an account, such as a password or a passkey. It establishes which account is being used, not what that account may do. methods it accepts, whether it supports PKCEProof Key for Code Exchange, pronounced pixie: the client creates a secret for each authorization attempt, sends only a hash of it at the start, and proves it holds the secret when redeeming the code, so a stolen authorization code is useless to anyone else. and whether it promises iss on every response. This lesson follows the printer as it learns those facts from the photo service's own published description, finds that description from one trusted value, and refuses a description that speaks for the wrong server.
Starting from the issuer
The printer's photo book feature never signs anyone in. It asks the photo service for an access tokenA token that a client presents to an API to use access it has been granted, usually limited in what it allows and how long it lasts. It authorizes API calls; it does not tell the client who signed in. that can read Ava's photos, and nothing more. For a long time its developers configured that by reading the photo service's documentation and copying values into the printer's settings: two endpoint addresses, the scopes the service defines, the client authentication methods its token endpointThe authorization server address where clients exchange an authorization code, refresh token, or other grant for tokens, in a direct request rather than through a browser redirect. accepts, and whether it supports PKCE.
Copying works until something changes. The photo service adds an endpoint for pushed authorization requestsAn OAuth extension, RFC 9126, in which the client sends its authorization request straight to the authorization server and gets back a short-lived request_uri. The browser carries only that reference, so the parameters cannot be read or changed on the way., starts returning the iss response parameter, or publishes a new signing key, and every client has to notice and update its settings by hand. Some of those values are addresses, but others are capabilities, and a few change what the client must check on every response. A client that guesses a capability wrong either fails outright or, worse, quietly skips a protection the server was ready to provide.
Provider discovery showed how a relying partyAn application that accepts and relies on a sign-in from another service, the name used in OpenID Connect and for passkeys. SAML calls the same role a service provider. solves this: it builds an address from one trusted issuer, fetches a JSONA text format for structured information, written as named values inside curly braces. APIs, tokens, and discovery documents all use it. document the provider publishes about itself, and checks that the document names that same issuer. Authorization server metadata, published as RFC 8414, is the same kind of document for OAuthA framework that lets a person give an application limited access to their resources at another service, using tokens instead of sharing their password. OAuth is about access; OpenID Connect adds sign-in.. It was generalized from OpenID Connect DiscoveryA JSON document that an OpenID Provider publishes at a well-known address under its issuer, listing its endpoints, where to find its signing keys, and its supported features so clients can configure themselves from one value. so that a client which only wants access tokens can configure itself from an authorization server that may not be an OpenID ProviderA service that authenticates users and tells other applications about the sign-in, so those applications never handle the users' passwords. In OpenID Connect it is called an OpenID Provider. at all. Current security guidance recommends that authorization servers publish it and that clients use it when it is available. The rules for checking the document carry over unchanged. What differs is where the document lives, which members a plain OAuth client reads most closely, and an optional way to have the contents vouched for.
All domains and values in these examples are fictional. The document is found from the authorization server's issuer identifier, an HTTPSHTTP protected by TLS, so traffic is encrypted and checked for changes while it travels. It protects the connection, but does not prove that the site at the other end is honest. URLA web address, such as https://photos.example/api/albums/42?limit=10. It names how to connect (https), the domain, the path to a particular page or resource, and any extra parameters after the question mark. with no query or fragment that names the server. For the photo service it is https://auth.photos.example. It is the iss value the printer compares on each authorization response in Checking the response issuer, and the iss claim in the photo service's JWT access tokens.
RFC 8414 registers its own well-known name, oauth-authorization-server, so a server that is not an OpenID Provider never has to publish anything called openid-configuration. The printer adds /.well-known/oauth-authorization-server to the issuer's host and asks for it:
GET /.well-known/oauth-authorization-server HTTP/1.1
Host: auth.photos.exampleHTTP/1.1 200 OK
Content-Type: application/json
{
"issuer": "https://auth.photos.example",
"authorization_endpoint": "https://auth.photos.example/authorize",
"token_endpoint": "https://auth.photos.example/token",
"code_challenge_methods_supported": ["S256"],
...
}Each name and value pair in the document is a member, the word RFC 8414 uses for the entries of a JSON object. Metadata shrinks the printer's trusted configuration to that one issuer, but it does not remove it. The printer still has to know that https://auth.photos.example is the authorization server for Ava's photo account, and it takes that value from its own configuration, never from an iss parameter, an error response or a link that arrived during a flow. That is the rule from Where trust starts, and it matters as much for access tokens as for sign-in.
Issuers with a path
One host can run more than one authorization server. A hosting provider might give each customer organization its own issuer on a shared domain, and the photo service could run a separate authorization server for business accounts with the issuer https://auth.photos.example/business.
Well-known paths are defined at the root of a host, so RFC 8414 puts the well-known name at the root and the issuer's path after it, removing any trailing slash from the issuer first. OpenID Connect Discovery, as Provider discovery showed, appends its name after the whole issuer instead. For an issuer with a path, the two rules give different places:
Issuer:
https://auth.photos.example/business
OAuth authorization server metadata (inserted):
https://auth.photos.example/.well-known/oauth-authorization-server/business
OpenID Connect discovery (appended):
https://auth.photos.example/business/.well-known/openid-configurationThe commonest mistake is to append the OAuth name to the issuer, giving https://auth.photos.example/business/.well-known/oauth-authorization-server. A client that does this looks in a place where no document is required to exist. With the insertion rule, each issuer on the host still has its own document, and the host's well-known documents all stay under one path.
For an issuer without a path, such as https://auth.photos.example, the two documents sit side by side at the root and differ only in their final name. An authorization server that is also an OpenID Provider can publish both, and one whose issuer has a path publishes at both addresses if it wants to serve both kinds of client.
The photo service's document
Here is the photo service's document in full, leaving out only the authentication methods accepted at the revocation and introspection endpoints:
{
"issuer": "https://auth.photos.example",
"authorization_endpoint": "https://auth.photos.example/authorize",
"token_endpoint": "https://auth.photos.example/token",
"pushed_authorization_request_endpoint": "https://auth.photos.example/par",
"device_authorization_endpoint": "https://auth.photos.example/device_authorization",
"revocation_endpoint": "https://auth.photos.example/revoke",
"introspection_endpoint": "https://auth.photos.example/introspect",
"registration_endpoint": "https://auth.photos.example/register",
"jwks_uri": "https://auth.photos.example/jwks",
"scopes_supported": ["photos.read", "photos.write", "photos.delete"],
"response_types_supported": ["code"],
"grant_types_supported": [
"authorization_code",
"refresh_token",
"client_credentials",
"urn:ietf:params:oauth:grant-type:device_code",
"urn:ietf:params:oauth:grant-type:jwt-bearer",
"urn:ietf:params:oauth:grant-type:token-exchange"
],
"code_challenge_methods_supported": ["S256"],
"token_endpoint_auth_methods_supported": ["client_secret_basic", "private_key_jwt", "none"],
"token_endpoint_auth_signing_alg_values_supported": ["ES256"],
"authorization_response_iss_parameter_supported": true,
"dpop_signing_alg_values_supported": ["ES256"],
"service_documentation": "https://photos.example/developers/oauth"
}Very little of this is required. RFC 8414 requires issuer and response_types_supported, and the authorization and token endpoints whenever the server supports grants that use them. Even jwks_uri is optional, because a plain OAuth client may never verify anything the server signs. OpenID Connect requires more, as Reading provider metadata showed: every relying party checks ID token signatures, so a provider must publish its key set, its subject types and its ID token algorithms.
Most of the other members were registered by the specifications that introduced them: the pushed authorization request endpoint from Pushing an authorization request, the iss support flag and the DPoP algorithms. Earlier lessons showed others this document can carry, such as the response modes for signed responses and the authentication context values a step-up challenge asks for. A server may also add members of its own, which a client skips when it does not recognize them. A member that would have no values is usually left out, but some servers send an empty list instead, and a client reads the two the same way.
The members ending in _endpoint are the addresses a developer used to copy. Pushed requests arrive at the first one ahead of the browser. The device authorization endpoint is where Ava's living-room photo frame started its request in Device authorization. Revocation and introspection are the back-channel endpoints from Token revocation and Token introspection. The registration endpoint accepts requests from software that wants to become a client without a person filling in a form, which Registering a client dynamically covers. As with a provider configuration, the client uses each address exactly as written, because nothing requires an endpoint to follow a naming pattern or share the issuer's host.
jwks_uri matters less to the printer than to a relying party. The printer treats access tokens as opaque. The photo API uses the key set to verify JWT access tokens, as Token formats and validation described, and a client needs it only when the server signs something addressed to the client, such as a signed authorization response. service_documentation is for people: a page where developers read what the document cannot express, such as how to request a scope that needs review.
What the server supports
The members ending in _supported describe capabilities. Several of them matter more to an OAuth client than anything in an OpenID Provider's sign-in entries:
grant_types_supportednames the grants this server handles: the authorization code and refresh token grants, client credentials for services acting as themselves, the device grant used by the frame, the JWT assertion grant from JWT and SAML assertion grants, and token exchange. When the member is missing, RFC 8414 defines a default of the authorization code and implicit grants, which is one reason a server should list its grants rather than leave clients to assume one that current guidance retires.code_challenge_methods_supportedis how a client detects PKCE. Current security guidance requires authorization servers to offer some way to detect PKCE support and recommends this member. If it is missing or empty, the server does not support PKCE, and a client that requires PKCE stops rather than continuing without it.token_endpoint_auth_methods_supportedlists the client authentication methods the token endpoint accepts. Because it includesprivate_key_jwt, the server must also list the algorithms it accepts for client assertions, here ES256.authorization_response_iss_parameter_supportedis the promise described in Checking the response issuer: every authorization response from this server carriesiss.dpop_signing_alg_values_supportedsays the server accepts DPoP proofs signed with ES256, so a client that proves possession of its key, as in Creating a DPoP proof, knows which algorithm to sign with.scopes_supportedlists the scopes the server chooses to advertise, and it may leave some out. A client uses it to confirm that the scopes it needs exist, not as a menu.
The value none means two different things. In the list of authentication methods it is the value for public clients, which identify themselves without authenticating. In a list of signing algorithms it would mean an unsigned JWT, and RFC 8414 forbids it there.
None of these lists describes the printer. grant_types_supported includes the device grant, but the printer's registration allows only the authorization code and refresh token grants, so a device authorization request from photo-printer is still refused, just as a relying party's registration narrows a provider's options in Reading provider metadata. Metadata tells a client which options exist. The client's registration decides which of them it may use, and each request is still decided on its own.
The issuer must match
The checks are the ones from Provider discovery: fetch the document over HTTPS, with the certificate checked, from the address built from the trusted issuer, then require its issuer to be identical to that issuer, character for character. If it is not, RFC 8414 says the client must not use any of the document. What changes for a plain OAuth client is what a bad document would steal. There is no ID token to forge. Instead the document decides where authorization codes, refresh tokens and the client's own credentials go.
In Authorization server mix-up, the printer also connected to a second photo service, Pixel Vault, whose authorization server at https://auth.pixelvault.example had been compromised. Suppose the attacker publishes this as Pixel Vault's metadata:
{
"issuer": "https://auth.photos.example",
"authorization_endpoint": "https://auth.pixelvault.example/authorize",
"token_endpoint": "https://auth.pixelvault.example/token",
...
}The document borrows the photo service's issuer and keeps Pixel Vault's endpoints. A printer that accepted it would expect https://auth.photos.example on every Pixel Vault response. Pixel Vault could then send Ava's browser on to the real photo service, whose honest response would pass the printer's iss check, and the code in it would go to Pixel Vault's token endpoint. That is the mix-up attack carried out through configuration, the gap that the response issuer check leaves for metadata validation to close. Because the document was fetched for https://auth.pixelvault.example, it must say exactly that, so it cannot speak for anyone else.
Fetched for the photo service
- Configured issuer
- https://auth.photos.example
- issuer in the document
- https://auth.photos.example
- token_endpoint
- https://auth.photos.example/token
Identical: use the document
Fetched for Pixel Vault
- Configured issuer
- https://auth.pixelvault.example
- issuer in the document
- https://auth.photos.example
- token_endpoint
- https://auth.pixelvault.example/token
Different: use none of it
Accepted, Pixel Vault's document would let the photo service's honest responses pass the iss check while their codes went to Pixel Vault's token endpoint.
The same rule holds on a shared host. The document at https://auth.photos.example/.well-known/oauth-authorization-server/business must name https://auth.photos.example/business. If it named https://auth.photos.example, the printer would reject it, because a document published for one issuer is never taken as describing another, even on the same host and with a valid certificate.
A client library might load the document like this, in TypeScript, with the insertion rule and both checks in one place. The comments say what each part does:
async function loadMetadata(issuer: string) {
const url = new URL(issuer);
if (url.protocol !== 'https:' || url.search || url.hash) {
throw new Error('An issuer must be an https URL with no query or fragment');
}
// Insert the well-known name between the host and any path.
const path = url.pathname.replace(/\/$/, '');
const address = `${url.origin}/.well-known/oauth-authorization-server${path}`;
// The HTTPS client checks the server certificate. Never turn that off.
// Refuse redirects: the document must come from the address built above,
// and following one could send the request somewhere nobody chose.
const response = await fetch(address, { redirect: 'error' });
if (response.status !== 200) throw new Error('Metadata is unavailable');
const metadata = await response.json();
// Compare with the configured issuer exactly, with no normalization.
if (metadata.issuer !== issuer) {
throw new Error('Issuer mismatch: do not use any part of this document');
}
return metadata;
}The comparison uses the issuer exactly as it was configured. If an operator types https://auth.photos.example/ with a trailing slash, the honest document fails, and the fix is the configured value, never a tidied comparison. Once accepted, the same string is what the printer expects in every iss response parameter and in the iss claim of the photo service's tokens.
The printer caches the document and fetches it again on a schedule, and every refreshed copy goes through the same checks, as Provider discovery described. A refresh that fails leaves the last validated copy in use. A copy that validates but stops advertising S256 or iss does not switch off PKCE or the iss check, for the reasons in Using metadata safely: the printer keeps its own expectations and alerts its operators.
Signed metadata
TLS and the issuer check prove that a document came from the issuer's host and claims to describe that issuer. They cannot show that anyone else stands behind the values. RFC 8414 offers an optional member for that, signed_metadata: a JWT whose claims repeat some or all of the metadata, signed by a party that vouches for them. Its iss claim names that party, which may be the authorization server itself or someone else, such as the operator of a group of services that agree to trust each other. The value is a compact JWT, shortened here:
"signed_metadata": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InBhcnRuZXItc2lnbmluZy0yMDI2In0.eyJpc3MiOiJodHRwczovL2F1dGgucGhvdG9zLmV4YW1wbGUiLCJpc3N1ZXIiOiJodHRwczovL2F1dGgucGhvdG9zLmV4YW1wbGUi..."Decoded, its header and payload read:
{ "alg": "ES256", "typ": "JWT", "kid": "partner-signing-2026" }
{
"iss": "https://auth.photos.example",
"issuer": "https://auth.photos.example",
"authorization_endpoint": "https://auth.photos.example/authorize",
"token_endpoint": "https://auth.photos.example/token",
"jwks_uri": "https://auth.photos.example/jwks",
"iat": 1792396800
}A client that does not support signed metadata may ignore the member. A client that does support it verifies the signature and gives the signed values precedence over the plain ones beside them. The signature is only worth something if the client trusts the signing key for a reason of its own. Here the photo service handed the public half of partner-signing-2026 to the printer's developers when the printer joined its partner program. A signed token endpoint then means more than the plain one: someone who could change the published file, at the content delivery network that caches and serves it for the photo service for example, still could not produce a valid signature. A key the client found through the same document's jwks_uri would prove nothing that TLS had not already proved, because whoever could change the document could change that address too.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Configure a client from nothing but an issuer, and validate the document firstRead Lab Photos' RFC 8414 metadata from its issuer, build path addresses, see a listed grant refused, refuse another tenant's genuine document, sign in through validated endpoints and alert when PKCE is withdrawn.