我剛剛熟悉 Azure 身份驗證,一開始我已經迷路了。
Microsoft.AspNetCore.Components.WebAssembly.Authentication我不知道和之間有什么區別Microsoft.Authentication.WebAssembly.Msal。
我可以看到第一個從 6.0.3 版本開始有效,最后一個從 6.0.4 開始有效,但我不知道為什么新版本比另一個更好以及如何使用它。
請不要給我減號——而是一個答案。
先感謝您。
uj5u.com熱心網友回復:
Microsoft.AspNetCore.Components.WebAssembly.Authentication并且Microsoft.Authentication.WebAssembly.Msal包提供了一組原語,幫助應用程式驗證用戶并獲取令牌以呼叫受保護的 API。
Microsoft.AspNetCore.Components.WebAssembly.Authentication通過身份驗證為 Blazor WebAssembly 應用提供安全性。這個包包括可以為應用程式提供訪問令牌的服務。
Microsoft.Authentication.WebAssembly.Msal提供了用于將 Microsoft 身份驗證庫 (MSAL) 與 Blazor WebAssembly 結合使用的型別。它使用 Azure Active Directory 和 Azure Active Directory B2C 對 Blazor Webassembly 應用程式進行身份驗證。
筆記:
Microsoft.Authentication.WebAssembly.Msal包將包Microsoft.AspNetCore.Components.WebAssembly.Authentication傳遞到應用程式。
這就是為什么Microsoft.Authentication.WebAssembly.Msal包優于Microsoft.AspNetCore.Components.WebAssembly.Authentication包的原因。
- 要安裝
Microsoft.Authentication.WebAssembly.Msal包,如下所示:
Install-Package Microsoft.Authentication.WebAssembly.Msal -Version 6.0.4
- 要使用
Microsoft.AspNetCore.Components.WebAssembly.Authentication包,請參閱MsDoc。
欲了解更多資訊,請參閱以下鏈接:
參考 1,參考 2,參考3 。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/460634.html
標籤:验证 天蓝色活动目录 blazor-webassembly
下一篇:無密碼短信驗證-令牌過期和安全
