Authorisation server metadata tells every client which endpoints to trust, which keys sign tokens and which security features are switched on, so a wrong or forged document quietly undoes the rest of an OAuth deployment. RFC 8414 defines the JSON document an OAuth 2.0 authorisation server publishes at a well-known URL, and OpenID Connect Discovery 1.0 defines the equivalent for OpenID providers. This reference picks out the fields that carry security meaning, explains the defaults that apply when a field is missing, and shows how to check a live server's document in a review or penetration test. It is written for identity engineers, API security testers and teams building MCP clients and servers. Field names keep the US spelling used in the specifications. For the protocol basics, read the OAuth 2.0 and OpenID Connect Guide first.
Key takeaways
- The issuer check is the whole point. RFC 8414 Section 3.3 says the returned
issuerMUST be identical to the issuer identifier the client used to build the URL, and if it is not, the data MUST NOT be used. - Missing fields have defaults, and some defaults are weak. If
grant_types_supportedis omitted it defaults to["authorization_code", "implicit"], and ifcode_challenge_methods_supportedis omitted the server is taken not to support PKCE. - Metadata is how clients find mix-up defences.
authorization_response_iss_parameter_supported(RFC 9207, default false) tells a client whether to expect theissparameter in authorisation responses. - MCP makes metadata mandatory reading. In MCP revision 2026-07-28, clients MUST validate the issuer, MUST refuse to proceed when
code_challenge_methods_supportedis absent, and MUST apply the RFC 9207issvalidation before sending a code to any token endpoint. - Treat metadata as configuration under change control. Every field change (a new grant type, a removed auth method, a new
jwks_uri) changes your attack surface and should be reviewed like a firewall rule.
What server metadata is
RFC 8414, "OAuth 2.0 Authorization Server Metadata", was published in June 2018 as a Standards Track RFC. The server publishes a JSON object over HTTPS; the client fetches it, checks it and uses it to configure itself. RFC 9700, the OAuth 2.0 Security Best Current Practice (BCP 240, January 2025), says it is RECOMMENDED that authorisation servers publish metadata and that clients use it when available, because it lets security features switch on automatically, reduces misconfiguration and eases key rotation.
Where the document lives: RFC 8414 inserts the well-known suffix between the host and the path of the issuer identifier. For issuer https://example.com the URL is https://example.com/.well-known/oauth-authorization-server; for https://example.com/issuer1 it is https://example.com/.well-known/oauth-authorization-server/issuer1. OpenID Connect Discovery 1.0 (Final, incorporating errata set 2) appends instead: https://example.com/issuer1/.well-known/openid-configuration. That difference matters for multi-tenant issuers and is a common source of fetching the wrong tenant's document.
Related documents: RFC 9728 (April 2025) defines Protected Resource Metadata, which a resource server publishes at /.well-known/oauth-protected-resource to name the authorisation servers it trusts. New fields are added through the IANA "OAuth Authorization Server Metadata" registry, so extensions such as PAR, DPoP and mTLS add their own entries.
| Document | Published by | Well-known suffix | Key validation rule |
|---|---|---|---|
| RFC 8414 Authorization Server Metadata | Authorisation server | oauth-authorization-server (path inserted) | issuer identical to the issuer used to build the URL |
| OpenID Connect Discovery 1.0 | OpenID provider | openid-configuration (path appended) | issuer identical to the issuer URL and to the iss claim in ID Tokens |
| RFC 9728 Protected Resource Metadata | Resource server (for example an MCP server) | oauth-protected-resource | resource identical to the resource identifier used |
Security-relevant fields
RFC 8414 lists more than twenty fields. The table covers the ones that change security behaviour, with the requirement level and the default when omitted, as written in the RFC or in the extension named.
| Field | Spec and status | Default if omitted | What to check |
|---|---|---|---|
issuer | RFC 8414, REQUIRED | None | HTTPS URL, no query or fragment; byte-identical to the expected issuer |
authorization_endpoint, token_endpoint | RFC 8414, REQUIRED unless no grant uses them | None | HTTPS, on a host you expect for this issuer |
jwks_uri | RFC 8414, OPTIONAL; OIDC Discovery, REQUIRED | None | HTTPS, same trust domain; the key set holds public keys only |
response_types_supported | RFC 8414, REQUIRED | None | Prefer code only; token signals implicit flow is live |
grant_types_supported | RFC 8414, OPTIONAL | ["authorization_code", "implicit"] | No password or implicit; list only grants you use |
code_challenge_methods_supported | RFC 8414, OPTIONAL | Server does not support PKCE | Present and contains S256 |
token_endpoint_auth_methods_supported | RFC 8414, OPTIONAL | client_secret_basic | Prefer private_key_jwt or tls_client_auth; question none outside public clients |
token_endpoint_auth_signing_alg_values_supported | RFC 8414, OPTIONAL; needed if JWT client auth is listed | None | Must not contain none (the RFC forbids it) |
registration_endpoint | RFC 8414, OPTIONAL | None | If present, is open registration intended and controlled? |
revocation_endpoint, introspection_endpoint | RFC 8414, OPTIONAL | None | Present where you need revocation; auth methods on each are restrictive |
authorization_response_iss_parameter_supported | RFC 9207 | false | true on any server used by multi-AS clients |
require_pushed_authorization_requests, pushed_authorization_request_endpoint | RFC 9126 | Not required | Whether PAR is enforced, not just offered |
dpop_signing_alg_values_supported | RFC 9449 | None | Asymmetric algorithms only |
tls_client_certificate_bound_access_tokens, mtls_endpoint_aliases | RFC 8705 | None | Aliases point to hosts in the same trust domain |
require_signed_request_object | RFC 9101 | Not required | Set where request integrity matters |
signed_metadata | RFC 8414 Section 2.1, OPTIONAL | None | If present, signed values take precedence over plain JSON; verify the signature and iss |
OpenID Connect Discovery adds its own REQUIRED fields, including subject_types_supported and id_token_signing_alg_values_supported, where RS256 MUST be included. The spec allows none in that list only for response types that return no ID Token from the authorisation endpoint, so none beside id_token response types is a finding. For the key side, see the JSON Web Key Sets (JWKS) and Signing Key Rotation Guide.
Issuer validation and the string comparison rules
RFC 8414 Section 4 tells clients to remove JSON escaping, to apply no Unicode normalisation at any point, and to compare code point by code point. The MCP authorisation specification goes further for the iss response parameter: no scheme or host case folding, no default port removal, no trailing slash or percent-encoding normalisation. In practice that means https://auth.example.com and https://auth.example.com/ are different issuers. RFC 8414 Section 3 tells the client to remove a trailing slash from the issuer before building the well-known URL, but the comparison itself is exact, so pick one form in configuration and keep it everywhere.
The check exists to stop impersonation. RFC 8414 Section 6.2 explains that an attacker could publish a document containing a real issuer's identifier and its own endpoints; matching the issuer to the one you asked for, over a TLS connection with a checked certificate, blocks that. OWASP ASVS 5.0 requirement V10.5.3 asks testers to verify exactly this behaviour.
PKCE and mix-up defence through metadata
PKCE: RFC 9700 says public clients MUST use PKCE, confidential clients are RECOMMENDED to, S256 is the only method that does not expose the verifier in the request, and authorisation servers MUST support PKCE and MUST provide a way to detect support. Publishing code_challenge_methods_supported is the recommended way. RFC 9700 also requires servers to defeat the PKCE downgrade attack: a token request carrying a code_verifier must be rejected when the original authorisation request carried no code_challenge. Metadata cannot prove that check is in place, so test it directly. See the PKCE Implementation guide.
Mix-up: a mix-up attack tricks a client that talks to several authorisation servers into sending a code or token for an honest server to an attacker's server. RFC 9700 makes a mix-up defence REQUIRED for clients that interact with more than one authorisation server, preferring the RFC 9207 iss parameter, with distinct redirect URIs per issuer only as a fallback. RFC 9207 tells clients to reject a response when metadata says iss is supported but it is missing, and to reject any response whose iss does not match the server the request went to. The iss value is only trustworthy if the expected issuer came from validated metadata or static configuration.
Checking a server's metadata
Use this sequence in a design review, a pre-production gate or an authorised test. Only test servers you own or are authorised to assess.
- Build the URL from configuration, not from the response. Take the issuer from your client configuration (or, for MCP, from the validated
authorization_serversentry in Protected Resource Metadata), then derive the RFC 8414 and OIDC URLs. Fetch over HTTPS with certificate checking on; RFC 8414 requires servers to support TLS 1.2 and clients to check the certificate under RFC 6125. - Confirm the response basics. HTTP 200 and
application/json. Redirects to another host, HTML error pages or cached copies from a CDN on a different domain all deserve a note. - Compare the issuer exactly. Byte for byte against the configured value, including trailing slash and case. Any difference: stop, the document must not be used.
- Walk the field table. Record each security field, its value and whether the default applies because it is absent. Absent
grant_types_supportedmeans implicit is implied; absentcode_challenge_methods_supportedmeans no PKCE. - Check every URL field. Endpoints,
jwks_uri,mtls_endpoint_aliasesandregistration_endpointshould be HTTPS and on hosts you recognise for this issuer. Fetch the JWKS and confirm it holds public keys only, withkidvalues and algorithms that match your token validation settings. - Test behaviour, not just advertisement. Send an authorisation request without
code_challengewhere PKCE should be enforced; sendcode_challenge_method=plain; try a grant type not listed. The server should refuse each one if policy says so. - Diff against the last approved copy. Store an approved snapshot per issuer in version control and alert on any change. Treat added grants, auth methods or endpoints as change requests.
Red flags in metadata
| What you see | Why it matters | Action |
|---|---|---|
issuer differs from the requested issuer (even by a slash) | Possible impersonation or wrong tenant; spec says do not use | Reject; fix configuration so both use one form |
code_challenge_methods_supported absent, or only plain | No PKCE, or a method that exposes the verifier | Enable S256 enforcement; MCP clients must refuse |
grant_types_supported absent or lists password or implicit | RFC 9700: ROPC MUST NOT be used; implicit SHOULD NOT be used | Disable the grants and list only those in use |
response_types_supported includes token | Access tokens in the front channel | Move clients to code with PKCE |
none in a signing algorithm list | Forbidden for token endpoint auth; unsafe for ID Tokens in front-channel flows | Remove |
Only client_secret_basic or client_secret_post for confidential clients | Shared secrets leak; RFC 9700 recommends asymmetric methods | Offer private_key_jwt or mTLS and migrate |
authorization_response_iss_parameter_supported absent on a server used by multi-AS clients | Clients cannot rely on iss for mix-up defence | Enable RFC 9207 and set the flag |
Open registration_endpoint with no stated policy | Anyone can create clients | Restrict, require software statements or review; see the OAuth Dynamic Client Registration Security Guide |
| URL fields on unrelated hosts or plain HTTP | Tokens or keys served from outside the trust boundary | Correct the document; investigate how it changed |
Metadata in MCP and agent flows
MCP revision 2026-07-28 (checked November 2026) builds its authorisation flow on metadata. MCP servers MUST publish Protected Resource Metadata (RFC 9728) with at least one entry in authorization_servers; authorisation servers MUST provide RFC 8414 metadata or OpenID Connect Discovery; clients MUST support both. For an issuer with a path such as https://auth.example.com/tenant1, clients MUST try, in order, the RFC 8414 path-inserted URL, the OIDC path-inserted URL, then the OIDC path-appended URL. See the MCP Authorisation Specification Guide for the full flow.
- Issuer validation: the specification gives an example: a document fetched from an attacker's host that claims
"issuer": "https://honest.example"MUST be rejected. - PKCE gate: if
code_challenge_methods_supportedis absent, clients MUST refuse to proceed, and OpenID providers serving MCP MUST include the field even though OIDC Discovery does not define it. - Recorded issuer: before redirecting, the client MUST record the issuer from validated metadata alongside the PKCE verifier, then apply RFC 9207 checks to the response before sending the code to any token endpoint. The specification signals that a future revision is expected to make server inclusion of
issa MUST. - SSRF: because clients fetch metadata from issuers named by a resource server, RFC 9728 Section 7.7 warns that a malicious resource can point clients at internal hosts. Agents and gateways that fetch metadata on demand should block internal address ranges and cap redirects. See MCP Authorisation URL Injection.
- Per-server state: clients MUST keep separate registration state per authorisation server, which is also what makes
isschecking meaningful. Client ID Metadata Documents, the default registration route for unknown clients in this revision, are covered in the OAuth Client ID Metadata Documents (CIMD) Guide.
The non-human identity angle is direct: agents, CI jobs and integration services are the clients most likely to discover servers dynamically and least likely to have a human notice a strange consent screen. Pin the issuers each agent may use, and alert when an agent fetches metadata from an issuer outside that list.
Detection, measurement and framework mapping
What to monitor: changes to each issuer's metadata document (hash and field diff), client-side logs of issuer mismatches and rejected iss values, token requests that carry a verifier without a matching challenge, and metadata fetches to unexpected hosts from agent runtimes.
- Issuer coverage: percentage of production clients whose metadata issuer check is enabled and tested.
- PKCE enforcement: percentage of authorisation servers that advertise S256 and reject requests without a challenge in testing.
- Legacy grants: number of issuers still listing
implicitorpassword, target zero. - Asymmetric client auth: share of confidential clients using
private_key_jwtor mTLS. - Unreviewed changes: metadata changes deployed without an approved change record, target zero.
| Framework | Reference | How metadata checks support it |
|---|---|---|
| NIST SP 800-53 Rev 5 | IA-9 Service Identification and Authentication | Clients authenticate the authorisation server through issuer and TLS checks |
| NIST SP 800-53 Rev 5 | SC-8 Transmission Confidentiality and Integrity; SC-23 Session Authenticity | HTTPS metadata and endpoints; iss binds responses to the session |
| NIST SP 800-53 Rev 5 | CM-6 Configuration Settings | Approved metadata snapshots and change control |
| NIST CSF 2.0 | PR.AA-03; PR.PS-01 | Services authenticated; configuration management applied |
| OWASP ASVS 5.0 | V10.2.2, V10.4.6, V10.5.3 | Mix-up defence, PKCE enforcement, rejection of impersonating metadata |
| MITRE ATT&CK | T1528 Steal Application Access Token; T1557 Adversary-in-the-Middle | Forged metadata and mix-up are routes to stolen codes and tokens |
Practitioner checklist
- Configure one canonical issuer string per authorisation server and compare it exactly against every fetched metadata document.
- Fetch metadata only over HTTPS with certificate checks, and never follow redirects to another host.
- Confirm
code_challenge_methods_supportedcontainsS256and test that requests without a challenge, and downgrade attempts, are rejected. - Remove
implicitandpasswordgrants and listgrant_types_supportedexplicitly so the weak default never applies. - Enable RFC 9207
isson every server, setauthorization_response_iss_parameter_supportedto true, and make multi-server clients check it. - Move confidential clients to
private_key_jwtor mTLS and check that no signing algorithm list containsnone. - Keep an approved snapshot of each issuer's metadata in version control and alert on diffs.
- For MCP clients and agents, pin allowed issuers, block internal address ranges on metadata fetches and refuse servers without PKCE metadata.
Standards and references
- IETF: RFC 8414 OAuth 2.0 Authorization Server Metadata
- IETF: RFC 9207 OAuth 2.0 Authorization Server Issuer Identification
- IETF: RFC 9700 Best Current Practice for OAuth 2.0 Security
- IETF: RFC 9728 OAuth 2.0 Protected Resource Metadata
- OpenID Foundation: OpenID Connect Discovery 1.0
- IANA: OAuth Parameters registries
- Model Context Protocol: Authorization Server Discovery
- Model Context Protocol: Authorization Security Considerations
Related NHI Mgmt Group resources: OAuth 2.1, GNAP and FAPI Guide, JWT Client Authentication (private_key_jwt) Guide, DPoP Guide, OAuth Pushed Authorization Requests and JAR Guide and Self-Hosted OIDC Issuer Security Guide.