Azure / Azure/azure-functions-openapi-extension

Clarification openapi working with easy auth

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

Description

Hello, I'm trying to setup a swagger document that describe my azure function apis to consume then via some power apps, **the function uses easy auth authentication**.
Since azure functions has a neat "Export to power automate, see below" capability, I decided to give it a go and here I'm reporting my findings.
![image](https://github.com/Azure/azure-functions-openapi-extension/assets/3263338/2d4ed864-e8c2-4f48-aada-e14b2316c1a0)

First of all, if the function uses easy auth, we can't get access to the open api specification in the portal because it will most likely return 401.
![image](https://github.com/Azure/azure-functions-openapi-extension/assets/3263338/89c4d757-4254-4ecc-a45b-a404e323c1f4)
Adding CORS solved nothing because as you can see from the network tab, easy auth return a 401 for the unauthorized request
![image](https://github.com/Azure/azure-functions-openapi-extension/assets/3263338/17f4f385-4e16-4ea8-b99c-74a7b7362de3)
So I decided to temporarily disable easy auth (which by the way takes two confirmations not sure why that's the case)

___
**Confirmation 1**
![image](https://github.com/Azure/azure-functions-openapi-extension/assets/3263338/f7e3c5ff-5d59-465a-8771-9d5ed6a87a02)
**Confirmation 2**
![image](https://github.com/Azure/azure-functions-openapi-extension/assets/3263338/c7d69b4a-a1e7-4da4-8b9a-16202a420168)
___

At this point I can finally choose my power platform environment, give a name at the custom api, choose a **security schema**
![image](https://github.com/Azure/azure-functions-openapi-extension/assets/3263338/ef52addc-d11d-465b-9f9d-b33b6207a219)

Since I'm using easy auth, I'm going to pick azure ad and start to fill in the details till wait.. the screen updates and now all of a sudden you have no option to choose any security scheme because my openapi definition doesn't define any as suggested [here](https://github.com/Azure/azure-functions-openapi-extension/blob/main/docs/openapi-auth.md#oauth2-easy-auth-flow)

This is the updated screen:
![image](https://github.com/Azure/azure-functions-openapi-extension/assets/3263338/6b26e848-6d16-4ca1-b34f-9fc649189968)

On top of that the creation fails with this error:
![image](https://github.com/Azure/azure-functions-openapi-extension/assets/3263338/b020cf51-c297-4ccb-bdb7-76bdaaec6675)

**So my question is**: Are these parts supposed to play nicely together? Because that's absolutely not the case at the moment :) Seems like these functionalities (which could be very handy to save some time) are fighting each other and the customer experience is something like: Did they test this before putting it live? :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.