I'm just getting acquainted with Azure authentication and I am already lost at the beginning.
I do not find what is the difference between Microsoft.AspNetCore.Components.WebAssembly.Authentication and Microsoft.Authentication.WebAssembly.Msal.
I can see that first is valid from version 6.0.3 and the last is from 6.0.4 but I do not know why the new one is better than the other and how can I use it.
Please don't give me minus - rather an answer.
Thank you in advance.
CodePudding user response:
Microsoft.AspNetCore.Components.WebAssembly.AuthenticationandMicrosoft.Authentication.WebAssembly.Msalpackages provide a set of primitives that help the application to authenticate users and obtain tokens to call protected APIs.
Microsoft.AspNetCore.Components.WebAssembly.Authentication provides security with authentication for Blazor WebAssembly apps. This package includes services that can provision access tokens for an application.
Microsoft.Authentication.WebAssembly.Msal provides types for using the Microsoft Authentication Library (MSAL) with Blazor WebAssembly. It authenticates Blazor webassembly applications with Azure Active Directory and Azure Active Directory B2C.
Note:
The
Microsoft.Authentication.WebAssembly.Msalpackage transitively adds theMicrosoft.AspNetCore.Components.WebAssembly.Authenticationpackage to the app.
This is why, Microsoft.Authentication.WebAssembly.Msal package is better than Microsoft.AspNetCore.Components.WebAssembly.Authentication package.
- To install
Microsoft.Authentication.WebAssembly.Msalpackage include it like below:
Install-Package Microsoft.Authentication.WebAssembly.Msal -Version 6.0.4
- To use
Microsoft.AspNetCore.Components.WebAssembly.Authenticationpackage refer the MsDoc.
For more information, please refer below links:
