I'm developing validation against a swagger schema. I have a question regarding multiple authentications, imagine I have a security block
security:
- header
- cookie
Logic is like this - parse a user request, and put header/cookie inside some hashmap/dict V
.
- If a user has provided no header/cookie - return an error
- If a user has provided the only header, add header value to
V
,V["header"] = request.header.value
- If a user has provided the only cookie, add cookie value to
V
,V["cookie"] = request.cookie.value
But what should I do if a user has provided both cookie and header? Should I return an error (oneOf) or put the only header to the V
variable (depends on the order of security) or put both header and cookie in the V
or it depends on the application logic?
I have read https://swagger.io/docs/specification/authentication/, but it is still unclear to me.