簡體   English   中英

Azure easy auth get user role based on AD user Id ASP.net core app WebAPI

[英]Azure easy auth get user role based on AD user Id ASP.net core app WebAPI

我正在關注鏈接以進行身份驗證和授權。

我能夠基於https://login.microsoftonline.com/{tenantID}/oauth2/token成功創建令牌

之后,我使用 sayhello 調用 GET API。 一切都很好,但我想根據 AD 用戶的令牌和 UserId/Password 獲取用戶角色。 我搜索了很多,但沒有得到任何具體的解決方案。

To decode the Azure Active Directory JWT token using the tool, you can use this online decode tool JSON Web Tokens - jwt.io .

這是一個關於如何驗證和解碼 Azure Active Directory 令牌的示例,請參閱本文

如果要使用 azure 活動目錄手動解碼持有者令牌,可以使用JwtBearerAddAzureADBearer中間件來驗證訪問令牌。

請參考這個線程,其中包含解碼承載令牌的代碼。

暫無
暫無

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

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