3

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?

William YK
  • 1,025
  • 12
  • 26
  • Don't see it documented but it seems like option.UrlPrefixes would allow multiple prefixes, so try adding both NoAuth and WithAuth in the same block. Needless to say the client endpoints would be different but that might be manageable. – amit_g Feb 01 '21 at 03:36
  • @amit_g if I did that, wouldn't I be publishing an unsecured endpoint? When I use the Azure+Auth, I can't see anything swagger-related without the token, which ends up looking like an extra HTTP header. So I'm trying to expose the Swagger docs but prevent the "try it out" part. I just want people interacting with the API to be able to see the documentation but still need the token to -use- the API if that makes sense. – William YK Feb 01 '21 at 16:52

0 Answers0