Azure / Azure/azure-functions-openapi-extension

Cannot access the swagger ui or openAPI doc endpoints after setting Auth to Function level

Open
#468 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
388
Forks
202
PR merge metrics
No merged PRs in 30d

Description

**Cannot access the swagger ui or openAPI doc endpoints after setting Auth to Function level**
If you set the open API auth level to anything other than Anonymous (User, Function, System or Admin), the swagger/ui and the openAPI doc endpoints become unaccessible.

**To Reproduce**
Steps to reproduce the behavior:
1. Create sample Azure function project:
a. .NET 6.0
b. HTTP trigger with OpenAPI
3. Publish it to the azure
4. Add these settings on the Function App's Configuration page:
![image](https://user-images.githubusercontent.com/18514793/183903214-98f734c7-c916-4016-8408-3fca4f715e65.png)
5. Browse `https:///api/swagger/ui?code=123` or `https:///api/swagger.json?code=123`

**Expected behavior**
You should see the desired page

**Actual behavior**
Error 401
![Screenshot_1](https://user-images.githubusercontent.com/18514793/184127997-8953a8ac-0238-4b7a-8304-f993991135c1.png)

**Environment**
- OS: Windows 11
- Browser chrome
- Version 1.3.0

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue using a .NET 6.0 HTTP-triggered Azure Functions project with OpenAPI and the documented Function-level settings. Start with the swagger/ui and swagger.json endpoints and compare their authentication handling with the expected code query parameter. Done means both endpoints load successfully with non-Anonymous auth levels.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, openapi
Domain
api, authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.