Is MSAL client side?

Joe S George 46 Reputation points
2020-05-20T16:54:51.233+00:00

Hi Team,

I am trying to to add azure AD B2C authentication to my project. The example code that I found includes msal. I am using nodeJS. Now I am getting the error "navigator is not defined".

code:
const clientId = "INSERT-CLIENT-APP-ID"; // Client Id of the registered application
const callback = (errorDesc, token, error, tokenType) => {};
// An Optional options for initializing the MSAL @SEE https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options
const options = {
redirectUri: "Your redirect URI",
};
const graphScopes = ["user.read", "mail.send"]; // An array of graph scopes

// Initialize the MSAL @SEE https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#initialization-of-msal
const userAgentApplication = new UserAgentApplication(clientId, undefined, callback, options);
const authProvider = new MSALAuthenticationProvider(userAgentApplication, graphScopes );

link: https://video2.skills-academy.com/en-us/graph/sdks/create-client?view=graph-rest-1.0&tabs=Javascript

Is msal client side? If so is there any alternative?.

Please help. Thank You

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,083 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jai Verma 461 Reputation points
    2020-05-20T17:09:38.213+00:00

    AAD B2C primarily use MSAL as they also call it v2 application. I strongly suggest you to use MSAL. Did you try sample app here - https://github.com/AzureADQuickStarts/B2C-WebApp-OpenIDConnect-NodeJS

    Could you compare how auth request is made here against yours?

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.