OAuth Discovery Generator
Create OAuth discovery metadata for authorization servers and protected APIs. Generate standards-oriented JSON, review its configuration and publish it at the correct well-known URL.
3. Generated JSON
Choose the document type and enter your real OAuth endpoint information. The generated JSON, publication URL, warnings, and export options will appear here.
Publication checklist
- Use your deployed HTTPS issuer or resource identifier.
- List only real endpoints and supported capabilities.
- Publish the JSON at the generated well-known URL.
- Serve HTTP 200 with
Content-Type: application/json. - Check that the published identifier matches exactly.
- Test your actual authorization flow and security controls separately.
What is OAuth discovery?
OAuth discovery is a standard way for applications and AI agents to learn how a service handles authorization. Instead of asking every integrator to manually configure endpoint addresses, a service can publish public JSON metadata that identifies its endpoints, supported authorization flows and relevant capabilities.
There are two closely related documents. RFC 8414 explains discovery for an authorization server that issues tokens. RFC 9728 explains discovery for protected resources such as APIs. Many integrations use both.
Why OAuth discovery matters for AI optimisation
AI search is not limited to finding pages. Some AI systems also connect to tools and services, subject to user authorization and platform support. A compatible client may need to discover which authorization server protects an API, which endpoint accepts authorization requests and how token exchanges work. Standard metadata reduces manual integration work and makes these configurations easier to locate.
This belongs to technical AI Discoverability, particularly for APIs and agent-enabled applications. It is different from optimizing article structure or achieving a citation in an AI-generated answer. Publishing OAuth metadata does not improve search rankings by itself, grant an agent access or bypass user consent.
Authorization server versus protected resource
| Question | Authorization server metadata | Protected resource metadata |
|---|---|---|
| What does it describe? | Server issuing OAuth tokens | API or other resource accepting tokens |
| Specification | RFC 8414 | RFC 9728 |
| Main required identifier | issuer | resource |
| Typical fields | Authorization and token endpoints, grant types, response types | Authorization server issuers and supported scopes |
| Default publication path | /.well-known/oauth-authorization-server | /.well-known/oauth-protected-resource |
How discovery works in practice
- An API advertises the resource it represents and may identify supported authorization servers.
- A compatible client obtains the authorization server's metadata and verifies the issuer identifier.
- The client learns where supported authorization flows begin and where tokens may be issued.
- Authorization and token exchange take place using the actual server implementation and its security requirements.
- The client presents authorized tokens to the protected API, which still verifies permissions and enforces access.
Metadata assists discovery. It does not implement any of those security controls.
How to use the OAuth Discovery Generator
Step 1: Choose the correct document
If you operate the server that issues OAuth tokens, choose Authorization server. If you operate an API that accepts OAuth access tokens, choose Protected resource. A service can have both documents.
Step 2: Enter existing configuration
Use the exact identifiers and HTTPS endpoints from your deployed application. Select only actual grants, response types, authentication methods and scopes. Avoid publishing aspirational capabilities that the server cannot support.
Step 3: Review and export
Generate JSON, address the validation warnings, copy the output or download it. The publication URL is calculated according to the relevant specification, including issuer or resource path segments where applicable.
Step 4: Publish and verify
Deploy the JSON at the expected well-known URL using the correct content type. Confirm that it is accessible and that the identifier inside the document matches the identifier used to derive the discovery URL. Validate real OAuth flows separately.
Important fields explained
Issuer and resource identifiers
The issuer identifies the authorization server, while the resource identifier identifies an API or protected service. Their exact values matter because clients use them to connect discovered metadata to the intended server and prevent confusion between services.
Endpoints and grants
The authorization endpoint handles interactive authorization where applicable. The token endpoint supports token issuance and exchange for supported grants. Grant types indicate which OAuth flows the server actually offers, while response types specify the supported authorization response formats.
Scopes, authentication and JWKS
Scopes indicate available permission names. Token endpoint authentication methods explain how supported clients authenticate themselves. A public JWKS endpoint can expose verification keys but must not publish private signing material.
Security and common mistakes
Publishing discovery metadata is a configuration step, not proof that the service is secure. Use HTTPS, avoid exposing secrets, verify tokens and audiences, enforce scopes, protect endpoints, and check the precise issuer or resource identity. A missing metadata file may make integrations less convenient, but a misleading file can be worse because it directs clients to capabilities that do not exist.
For new implementations, favor current security guidance such as OAuth 2.0 Security Best Current Practice (RFC 9700) and PKCE (RFC 7636). The generator highlights legacy flows for this reason.
How OAuth discovery relates to other AI readiness tools
OAuth metadata matters most when an AI system needs to connect to an authorized service. For a broader assessment, use the Site Agent Readiness Checker. To inspect other emerging agent protocols, use the Emerging Protocols Checker. If your service publishes a catalog of agent capabilities, use the Agentic Resource Discovery Checker. Explore all AI search optimisation tools.
Official references
- IETF RFC 8414: OAuth 2.0 Authorization Server Metadata
- IETF RFC 9728: OAuth 2.0 Protected Resource Metadata
- IETF RFC 6749: OAuth 2.0 Authorization Framework
- IETF RFC 9700: OAuth 2.0 Security Best Current Practice
- IETF RFC 7636: Proof Key for Code Exchange
- RFC 8414 reported erratum 7793: response types for non-interactive grants
- IETF RFC 8615: Well-Known Uniform Resource Identifiers