azure-functions-openapi-extension
azure-functions-openapi-extension copied to clipboard
OpenApiSecurity Decorator, Multiple Authentication Types
According to the swagger documentation, there is a possibility to use multiple authentication types by combining the security requirements using a logical OR / AND operator. If I set two OpenApiSecurity attributes, i.e:
[OpenApiSecurity("function_key", SecuritySchemeType.ApiKey, Name = "code", In = OpenApiSecurityLocationType.Query)]
[OpenApiSecurity("user_auth_header", SecuritySchemeType.Http, Scheme = OpenApiSecuritySchemeType.Bearer, BearerFormat = "JWT", Name = "Authorization")]
the security schema of generated yaml will look like the logical OR is always used.
security: # function_key OR user_auth_header
- function_key
- user_auth_header
Is there any way how can I configure AND operator like:
security: # function_key AND user_auth_header
- function_key
user_auth_header
I would love if someone shows me the postman call to test:
[OpenApiSecurity("user_auth_header", SecuritySchemeType.Http, Scheme = OpenApiSecuritySchemeType.Bearer, BearerFormat = "JWT", Name = "Authorization")]