Sunday, September 26, 2021

Understand msal-react package used for react js project



In order to use Azure authentication for react project, two packages are needed to be installed in react project.

npm install @azure/msal-react @azure/msal-browser

Package @azure/msal-browser is the base package, which implements the basic function for msal authentication for javascript project, including server side node projects and client side html/js project.

Package @azure/msal-react is wrapper package around @azure/msal-browser, it provides react specific feature, like react hook and context, so react developers can easily integrate the msal features into the react projects.

To get familiar with msal-react package, developers should first read the document in 

https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-react#advanced-topics

https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-react

Developer may also want to refer to the document at the below link for msal-browser package, in order to understand certain inherited functions provided by msal-react package.

https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser


  

 


No comments:

Post a Comment