Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 16 and 17 : BrowserAuthError: uninitialized_public_client_application #6691

Closed
memory660 opened this issue Nov 13, 2023 · 8 comments
Closed
Labels
bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-angular Related to @azure/msal-angular package msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.

Comments

@memory660
Copy link

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

3.5.0

Wrapper Library

MSAL Angular (@azure/msal-angular)

Wrapper Library Version

3.5.0

Public or Confidential Client?

Public

Description

no error with :
"@azure/msal-angular": "3.0.0-alpha.2", "@azure/msal-browser": "3.0.0-alpha.2",

error with
"@azure/msal-angular": "^3.0.8", "@azure/msal-browser": "^3.5.0",

Error Message

ERROR BrowserAuthError: uninitialized_public_client_application: You must call and await the initialize function before attempting to call any other MSAL API. For more visit: aka.ms/msaljs/browser-errors

Msal Logs

No response

MSAL Configuration

export function MSALInstanceFactory(): IPublicClientApplication {
  return new PublicClientApplication({
    auth: {
      clientId: environment.msalConfig.auth.clientId,
      authority: environment.msalConfig.auth.authority,
      redirectUri: '/',
      postLogoutRedirectUri: '/'
    },
    cache: {
      cacheLocation: BrowserCacheLocation.LocalStorage
    },
    system: {
      allowNativeBroker: false, // Disables WAM Broker
      loggerOptions: {
        loggerCallback,
        logLevel: LogLevel.Info,
        piiLoggingEnabled: false
      }
    }
  });
}

Relevant Code Snippets

AppModule
`ts
  providers: [
    {
      provide: HTTP_INTERCEPTORS,
      useClass: MsalInterceptor,
      multi: true
    },
    {
      provide: MSAL_INSTANCE,
      useFactory: MSALInstanceFactory
    },
`

Reproduction Steps

from launch

Expected Behavior

no more errors

Identity Provider

Azure AD / MSA

Browsers Affected (Select all that apply)

Chrome

Regression

@azure/msal-browser: ^3.5.0

Source

External (Customer)

@memory660 memory660 added bug-unconfirmed A reported bug that needs to be investigated and confirmed question Customer is asking for a clarification, use case or information. labels Nov 13, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Nov 13, 2023
@github-actions github-actions bot added msal-angular Related to @azure/msal-angular package msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications labels Nov 13, 2023
@lalimasharda
Copy link
Contributor

Hey @memory660 we do not support Angular 17 yet. For your issue with Angular 16, please take a look at #6693 ! Let me know if you need more help.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels Nov 14, 2023
@memory660
Copy link
Author

@lalimasharda , I can't find the solution in the link you gave me.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 Awaiting response from the MSAL.js team and removed Needs: Author Feedback Awaiting response from issue author labels Nov 15, 2023
@mlz11
Copy link

mlz11 commented Nov 16, 2023

Hey @memory660 we do not support Angular 17 yet. For your issue with Angular 16, please take a look at #6693 ! Let me know if you need more help.

Hello @lalimasharda, do you have any idea on when you would support Angular 17 ?
Thank you 🙏🏻

@mlz11
Copy link

mlz11 commented Nov 21, 2023

Hey @memory660 we do not support Angular 17 yet. For your issue with Angular 16, please take a look at #6693 ! Let me know if you need more help.

Hello @lalimasharda, do you have any idea on when you would support Angular 17 ? Thank you 🙏🏻

🆙 🙏🏻

@javargasm
Copy link

support Angular 17 Pliss

@muhamedkarajic
Copy link

Angular 17, support, please, arigato. :)

@mlz11
Copy link

mlz11 commented Dec 1, 2023

Hey @memory660 we do not support Angular 17 yet. For your issue with Angular 16, please take a look at #6693 ! Let me know if you need more help.

Hello @lalimasharda, do you have any idea on when you would support Angular 17 ? Thank you 🙏🏻

🆙 🙏🏻

Hey @lalimasharda @tnorling @konstantin-msft @jo-arroyo @hectormmg, sorry for mentioning you all...
Can we please get an answer on that matter ? 🙏🏻

@tnorling
Copy link
Collaborator

Angular 17 support is being tracked in #6719, any updates we have to share will be posted there.

As for the original issue concerning the uninitialized error - you need to do one of the following:

  1. Bootstrap the MsalRedirectComponent
  2. Call handleRedirectObservable

Additionally you must wait for inProgress to become None. More information here and here

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: Attention 👋 Awaiting response from the MSAL.js team label Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-angular Related to @azure/msal-angular package msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.
Projects
None yet
Development

No branches or pull requests

6 participants