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

BrowserAuthError: monitor_window_timeout: Token acquisition in iframe failed due to timeout. #7389

Open
2 tasks
pavankarthikparuchuri opened this issue Oct 21, 2024 · 3 comments
Labels
bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-browser Related to msal-browser package msal-react Related to @azure/msal-react Needs: Author Feedback Awaiting response from issue author no-issue-activity Issue author has not responded in 5 days public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.

Comments

@pavankarthikparuchuri
Copy link

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

3.5.0

Wrapper Library

MSAL React (@azure/msal-react)

Wrapper Library Version

None

Public or Confidential Client?

Public

Description

I am trying to show a popup as soon as the token expires. After the token gets expired we are showing a popup that will have the button to create a new token using acquireTokenSilent method. The token is being created and I am able to login for most of the time. But when the tab is being idle for long time and then when I try to login then facing this error(Error acquiring token: BrowserAuthError: monitor_window_timeout: Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors)

Error Message

main.8f947b7b.js:2 Error acquiring token: BrowserAuthError: monitor_window_timeout: Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors
at v (main.8f947b7b.js:2:2222865)
at main.8f947b7b.js:2:2155230
overrideMethod @ console.js:288
(anonymous) @ main.8f947b7b.js:2
p @ main.8f947b7b.js:2
(anonymous) @ main.8f947b7b.js:2
(anonymous) @ main.8f947b7b.js:2
r @ main.8f947b7b.js:2
l @ main.8f947b7b.js:2
Promise.then
r @ main.8f947b7b.js:2
s @ main.8f947b7b.js:2
(anonymous) @ main.8f947b7b.js:2
(anonymous) @ main.8f947b7b.js:2
k @ main.8f947b7b.js:2
onClick @ main.8f947b7b.js:2
Le @ main.8f947b7b.js:2
Be @ main.8f947b7b.js:2
(anonymous) @ main.8f947b7b.js:2
Fr @ main.8f947b7b.js:2
Gr @ main.8f947b7b.js:2
(anonymous) @ main.8f947b7b.js:2
cu @ main.8f947b7b.js:2
Pe @ main.8f947b7b.js:2
zr @ main.8f947b7b.js:2
Kt @ main.8f947b7b.js:2
Wt @ main.8f947b7b.js:2

MSAL Logs

No response

Network Trace (Preferrably Fiddler)

  • Sent
  • Pending

MSAL Configuration

auth: {
    clientId: REACT_APP_CLIENT_ID, // This is the ONLY mandatory field that you need to supply.
    authority: REACT_APP_AUTHORITY, // Defaults to "https://login.microsoftonline.com/common"
    redirectUri: window.location.href.includes("http://localhost:3000/")
      ? "http://localhost:3000/"
      : REACT_APP_REDIRECT_URI, // You must register this URI on Azure Portal/App Registration. Defaults to window.location.origin
    // postLogoutRedirectUri: `${process.env["REACT_APP_AAD_APP_REDIRECT_URI"]}`, // Indicates the page to navigate after logout.
    navigateToLoginRequestUrl: true, // If "true", will navigate back to the original request location before processing the auth code response.
  },
  cache: {
    cacheLocation: "sessionStorage", // Configures cache location. "sessionStorage" is more secure, but "localStorage" gives you SSO between tabs.
    storeAuthStateInCookie: false, // Set this to "true" if you are having issues on IE11 or Edge
  },
  system: {
    loggerOptions: {
      loggerCallback: (level, message, containsPii) => {
        if (containsPii) {
          return;
        }
        switch (level) {
          case LogLevel.Error:
            console.error(message);
            return;
          case LogLevel.Info:
            console.info(message);
            return;
          case LogLevel.Verbose:
            console.debug(message);
            return;
          case LogLevel.Warning:
            console.warn(message);
            return;
        }
      },
    },
  },

Relevant Code Snippets

const tokenResponse = await instance.acquireTokenSilent({
        ...loginRequest,
        account: accounts[0],
      });

Reproduction Steps

none

Expected Behavior

should be able to create a token without facing error

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Chrome, Firefox, Edge, Safari

Regression

No response

@pavankarthikparuchuri pavankarthikparuchuri 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 Oct 21, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Oct 21, 2024
@github-actions github-actions bot added msal-browser Related to msal-browser package msal-react Related to @azure/msal-react public-client Issues regarding PublicClientApplications labels Oct 21, 2024
@pavankarthikparuchuri
Copy link
Author

@sameerag
Copy link
Member

Do we have any STS error tracked in the background?

@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 Oct 28, 2024
Copy link
Contributor

@pavankarthikparuchuri This issue has been automatically marked as stale because it is marked as requiring author feedback but has not had any activity for 5 days. If your issue has been resolved please let us know by closing the issue. If your issue has not been resolved please leave a comment to keep this open. It will be closed automatically in 7 days if it remains stale.

@microsoft-github-policy-service microsoft-github-policy-service bot added the no-issue-activity Issue author has not responded in 5 days label Nov 3, 2024
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-browser Related to msal-browser package msal-react Related to @azure/msal-react Needs: Author Feedback Awaiting response from issue author no-issue-activity Issue author has not responded in 5 days 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

2 participants