---
title: "Discussion on \"Document API authentication in OpenAPI 3.1: Bearer, API keys, OAuth 2, and mTLS without the usual mistakes\" | Hashnode"
description: "Discussion on \"Document API authentication in OpenAPI 3.1: Bearer, API keys, OAuth 2, and mTLS without the usual mistakes\". Most OpenAPI auth docs are subtly wrong: a scheme is defined but never applied, a token is modeled as a plain header, or OAuth scopes do not match the server. Here is how to document each mechanism correctly, combine them with AND/OR semantics, and mark public endpoints."
url: "https://hashnode.com/posts/document-api-authentication-openapi-security-schemes/6aca07fa9fb08b8a12651488"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Document API authentication in OpenAPI 3.1: Bearer, API keys, OAuth 2, and mTLS without the usual mistakes](https://blogs.powerduck.com/document-api-authentication-openapi-security-schemes?utm_source=hashnode&utm_medium=feed)

Most OpenAPI auth docs are subtly wrong: a scheme is defined but never applied, a token is modeled as a plain header, or OAuth scopes do not match the server. Here is how to document each mechanism correctly, combine them with AND/OR semantics, and mark public endpoints.

Oct 6 · 6 min read · blogs.powerduck.com  
Read the article

-   [#openapi](https://hashnode.com/tag/openapi)
-   [#security](https://hashnode.com/tag/security)
-   [#authentication](https://hashnode.com/tag/authentication)
-   [#api](https://hashnode.com/tag/api)

## Written by

[Powerduck](https://hashnode.com/@powerduck)

@powerduck · hon

  
[View profile](https://hashnode.com/@powerduck)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
