---
title: "Discussion on \"Multiple security schemes in OpenAPI: AND vs OR, optional auth, and per-operation overrides\" | Hashnode"
description: "Discussion on \"Multiple security schemes in OpenAPI: AND vs OR, optional auth, and per-operation overrides\". The security array means OR, any one listed scheme is enough; combining schemes inside one requirement object means AND, all are required. Get this backwards and an endpoint that needs both an API key and a bearer token accepts just one, or a public endpoint demands credentials."
url: "https://hashnode.com/posts/openapi-multiple-security-schemes-and-or-optional-auth/6aca0762a28c0b359315d01b"
---

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

Discussion

# [Multiple security schemes in OpenAPI: AND vs OR, optional auth, and per-operation overrides](https://blogs.powerduck.com/openapi-multiple-security-schemes-and-or-optional-auth?utm_source=hashnode&utm_medium=feed)

The security array means OR, any one listed scheme is enough; combining schemes inside one requirement object means AND, all are required. Get this backwards and an endpoint that needs both an API key and a bearer token accepts just one, or a public endpoint demands credentials.

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

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

## Written by

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

@powerduck · hon

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

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
