0

I am using the React Login Microsoft-Graph-Toolkit component (see snippet Below) and MSAL2Provider to log users into my Active Directory application, which works well. However, I have a requirement to logout a user from a custom logout button. The button should be able to logout the current user session. Can anyone advise how do to initiate a login/logout using MSAL2Provider?

Code Snippet:

Providers.globalProvider = new Msal2Provider({
   clientId: "client-id"
 });
    
 <Login
   loginCompleted={(event) => {mgtSSOLoggedIn(event)}}
   loginFailed={(event) => {mgtSSOFailed(event)}}
 />
tlockhart
  • 381
  • 2
  • 7
  • Hi tlockhart , as you said you already used react-toolkit for login and now you are looking for MSAL2Provider , could you please check the below code snippet ,is this the one you looking for ? , ref doc - https://learn.microsoft.com/en-us/graph/toolkit/providers/msal2#initialize-in-your-html-page . – vicky kumar Jul 01 '22 at 10:48

1 Answers1

0

Actually, I was looking for the authentication process for MSALProvider. Please see link for details: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-react/docs/getting-started.md.

tlockhart
  • 381
  • 2
  • 7