寻求OpenID Connect对应的Swagger/OpenAPI规范文档获取渠道
Hey there! Great question—lots of folks hunt for an official OpenAPI spec for OpenID Connect and come up empty initially, so you’re definitely not alone. Here are the most reliable ways to get what you need:
社区维护的通用规范
Since the official OIDC standard doesn’t ship with a built-in OpenAPI spec, developer communities have stepped up. You’ll find well-maintained OpenAPI definitions that cover all core OIDC endpoints (like/authorize,/token,/userinfo, and the discovery endpoint/.well-known/openid-configuration) along with common flows (authorization code, implicit, client credentials, etc.). These are usually hosted on code platforms, and a quick search for "OpenID Connect OpenAPI spec" will turn up solid options you can reuse or tweak.身份提供商的定制化规范
If you’re working with a specific identity provider (IdP) like Keycloak, Auth0, or Okta, they provide their own OpenAPI/Swagger docs tailored to their OIDC implementation. For example, Keycloak exposes an OpenAPI endpoint that generates a spec specific to your realm’s configuration—this includes provider-specific extensions and settings, making it way more practical for your particular use case than a generic spec.手动构建或扩展现有规范
If you can’t find a perfect match, you can build your own using the official OIDC RFCs (like RFC 6749 for OAuth2 base, RFC 7636 for PKCE, RFC 7009 for token revocation). The specs clearly define all request headers, query parameters, and response structures for each endpoint. Tools like the Swagger Editor make this straightforward, or you can take a community spec and adjust it to fit your exact requirements (like adding custom claims or extensions).
One quick note: Remember that OpenID Connect is built on OAuth2, so many OAuth2 OpenAPI specs can be extended to include OIDC-specific components (like id_token responses, userinfo endpoints) if needed.
内容的提问来源于stack exchange,提问作者4integration

