question

JoeSGeorge-3299 avatar image
0 Votes"
JoeSGeorge-3299 asked ·

Is MSAL client side?

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://docs.microsoft.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

azure-active-directory
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JaiVerma-7010 avatar image
0 Votes"
JaiVerma-7010 answered ·

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?

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.