How can I use Azure Relay and MVC with auth and still view the Swagger documentation URL?

238 views Asked by At

For context, I'm very new to writing services, using Azure Relay, and Swagger, but I'm on the right track.

I have legacy WCF services that I'm writing a proxy wrapper for with ASP MVC Core, then I'm using Azure Relay hybrid connection to expose them for use to avoid firewall things.

When I run my application, Swagger shows my API's and the relevant documentation: enter image description here

I have created 2 hybrid relays in Azure. One that "Requires Client Authorization" and one that does not.

The code I'm using is pictured below to switch between (1) no AZ relay, (2) AZ relay with no auth, and (3) AZ relay with auth.

enter image description here

When I run using the Azure relay with no auth (2), I can see the API documentation:

enter image description here

When I run using the Azure relay with auth (3), I just get a token required.

enter image description here

I know how to call the API's w/a SAS token, but is it possible to somehow view/interact with the Swagger documentation??

How do I interact with the web-front of an API when the API (not documentation) itself needs to be secure?

0

There are 0 answers