Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
383 views
in Technique[技术] by (71.8m points)

asp.net mvc - How can I use Azure Relay and MVC with auth and still view the Swagger documentation URL?

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?

question from:https://stackoverflow.com/questions/65893020/how-can-i-use-azure-relay-and-mvc-with-auth-and-still-view-the-swagger-documenta

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...