You're right that standardization has real value, and I understand the frustration. The OAuth2 Password flow does seem like it would be a convenient way to standardize what many apps do anyway.
The core issue is that the OAuth working group made a deliberate choice to prioritize security patterns over convenience for this specific use case. They're essentially saying: "We know people build password-based auth all the time, but we don't want to standardize or encourage that pattern anymore, even for first-party apps."
For Swagger/OpenAPI specifically, there are a few options that don't require the password flow:
- OpenAPI supports cookie-based auth natively with
type: apiKey and in: cookie
- For JWT/bearer tokens, the standard
type: http and scheme: bearer works well
- For custom headers,
type: apiKey and in: header is supported
These don't require the full OAuth dance in your documentation, just the token/cookie you'd get after authentication. The spec doesn't care how you obtained that token.
If you really need the full OAuth flow documented in OpenAPI:
- You can document your Authorization Code endpoints with standard OAuth2 security schemes
- For a custom "/session" endpoint, you can document it as a regular API operation
I get that it feels like the standards body is forcing everyone to either:
- Use a more complex flow than needed for simple cases, or
- Go back to non-standardized approaches
That's a legitimate frustration. The OAuth WG has essentially decided that standardizing the password flow creates more harm than good, even though it means some common patterns fall outside the standard.