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

.loginPopup fails in full-screen browser #4839

Closed
StephenTHendrix opened this issue May 27, 2022 · 4 comments
Closed

.loginPopup fails in full-screen browser #4839

StephenTHendrix opened this issue May 27, 2022 · 4 comments
Assignees
Labels
answered Question has received "first qualified response" 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 question Customer is asking for a clarification, use case or information.

Comments

@StephenTHendrix
Copy link

StephenTHendrix commented May 27, 2022

Core Library

MSAL.js v2 (@azure/msal-browser)

Core Library Version

1.4.0

Wrapper Library

MSAL React (@azure/msal-react)

Wrapper Library Version

2.24.0

Description

When logging in from a full-screen browser, a new tab is opened allowing me to sign in, but I get redirected back to the login page. From here if I click the login button again, I see the route change to the Redirect URL and then back to the login page, though the login page remains displayed through this process. As soon as I come out of a full screen, however, I'm redirected properly and the flow works as expected.

Logging out works just fine in a full-screen browser; a new tab opens, I log out, and the original tab redirects to the login page.

To be clear, if the browser isn't maximized, there are no issues. Thanks!

Error Message

BrowserAuthError: hash_empty_error: Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash.

at BrowserAuthError.AuthError [as constructor] (AuthError.ts:45:1)
    at new BrowserAuthError (BrowserAuthError.ts:195:1)
    at Function.BrowserAuthError.createEmptyHashError (BrowserAuthError.ts:241:1)
    at PopupHandler.ts:62:1
overrideMethod @ react_devtools_backend.js:4026

Msal Logs

No response

MSAL Configuration

{
  auth: {
    clientId,
    authority,
    redirectUri,
  },
  cache: {
    cacheLocation,,
  },
  system: {
    loggerOptions,
  },
}

Relevant Code Snippets

import { useMsal } from '@azure/msal-react'

  const { instance } = useMsal()
  const scopes = {
  scopes: ['User.Read'],
}
  const login = await instance.loginPopup(scopes)

Reproduction Steps

  1. Open application in full-screen browser
  2. Click login button
  3. After being redirected to new tab, logging in, and being redirected back to login page, click login button again.
  4. Login page continues to be displayed while URL can be seen changing to Redirect URL and back to login page while error appears in console.

Expected Behavior

After clicking login button the first time and logging in, user authenticated and redirected to home page.

Identity Provider

Azure AD / MSA

Browsers Affected (Select all that apply)

Chrome, Firefox

Regression

No response

Source

External (Customer)

@StephenTHendrix StephenTHendrix 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 May 27, 2022
@ghost ghost assigned sameerag May 27, 2022
@ghost ghost added the Needs: Attention 👋 Awaiting response from the MSAL.js team label May 27, 2022
@github-actions github-actions bot added msal-browser Related to msal-browser package msal-react Related to @azure/msal-react labels May 27, 2022
@sameerag
Copy link
Member

@StephenTHendrix There is new guidance published on the redirects with #4793, can you please check that and let us know if there is any pattern that you can change in your application which can help here?

@ghost ghost added answered Question has received "first qualified response" Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels May 27, 2022
@StephenTHendrix
Copy link
Author

@sameerag thanks for the quick response! I'm not sure where I should be looking - do you mean this? https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-spa-sign-in?tabs=javascript2

Either way I don't yet see much I can do on my end, but that PR looks like it addresses my issue about perfectly! Any idea when it might get released? Thanks again!

@ghost ghost added Needs: Attention 👋 Awaiting response from the MSAL.js team and removed Needs: Author Feedback Awaiting response from issue author labels May 31, 2022
@sameerag
Copy link
Member

@StephenTHendrix Should be a part of June's msal-browser release.

@ghost ghost added Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels May 31, 2022
@sameerag
Copy link
Member

sameerag commented Jun 2, 2022

Closing. Please raise a new issue if the issue still persists post june release.

@sameerag sameerag closed this as completed Jun 2, 2022
@ghost ghost removed the Needs: Author Feedback Awaiting response from issue author label Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Question has received "first qualified response" 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 question Customer is asking for a clarification, use case or information.
Projects
None yet
Development

No branches or pull requests

2 participants