簡體   English   中英

獲取 swagger 以使用 Azure AD + spring 啟動配置進行身份驗證

[英]Get swagger to authenticate with Azure AD + spring boot configuration

我有一個 spring 引導 REST 服務,它受 Azure AD 保護,所以我使用 Spring 引導啟動程序來保護 Azure AD。

我還使用 springdoc-openapi 庫生成 API 文檔。 現在我正在手寫 yaml 文件來描述文檔。

我正在尋求有關獲取 swagger 以使用 Azure AD 進行身份驗證的幫助,以便我可以在后端試用端點。

有沒有辦法通過編輯 yaml 文件或使用 springdoc-openapi 庫來做到這一點?

For getting swagger to authenticate with Azure AD you need to create registered two web application one is for webAPI and another is for your swagger.Then you shoukd require Delegated Permissions for your Swagger Web Site to 'Access' your WebAPI.As swagger is in-在 .Net 5.0 模板中構建配置,這樣我們就不需要在這個最新的 .Net 5.0 中記錄我們的 API。

您可以在此處參考此文檔,他們在步驟中給出了如何使用 azuread 對 swagger 進行身份驗證。

您還可以參考此文檔了解如何設置 Swagger 以針對 Azure 進行身份驗證 Active Directory.net的開發者社區提供

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM