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

Popup fails to open https://login.microsoftonline.com/ #5296

Closed
diamant-isufi-sveasolar opened this issue Oct 13, 2022 · 8 comments
Closed
Assignees
Labels
answered Question has received "first qualified response" 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

@diamant-isufi-sveasolar

Core Library

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

Core Library Version

2.28.2

Wrapper Library

MSAL React (@azure/msal-react)

Wrapper Library Version

1.4.6

Public or Confidential Client?

Public

Description

There is this issue that sometimes the popup fails to open https://login.microsoftonline.com/, instead it opens the URL that my project is hosted in(e.g: staging.test123.com), so the URL is the same in the browser and in the popup. This leads to me not being able to complete the sign in, no errors appear in the info logger.

Am I missing something in the config, or should I provide any fallback route for https://login.microsoftonline.com/.

MSAL Configuration

auth: {
    clientId: process.env.REACT_APP_AZURE_CLIENT_ID,
    redirectUri: process.env.REACT_APP_AZURE_REDIRECT_URI,
    postLogoutRedirectUri: process.env.REACT_APP_AZURE_POSTLOGOUT_REDIRECT_URI,
  
  },
  cache: {
    cacheLocation: "localStorage",
    storeAuthStateInCookie: isIE || isEdge || isFirefox,
  },
  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;
          default:
            return;
        }
      },
    },
  }

Relevant Code Snippets

<MsalAuthenticationTemplate
      interactionType={InteractionType.Popup}
      authenticationRequest={authRequest}
      errorComponent={ErrorComponent}
      loadingComponent={LoadingComponent}>
      <LoginRedirect />
</MsalAuthenticationTemplate>

Identity Provider

Azure AD / MSA

Source

External (Customer)

@diamant-isufi-sveasolar diamant-isufi-sveasolar added the question Customer is asking for a clarification, use case or information. label Oct 13, 2022
@ghost ghost added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Oct 13, 2022
@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 13, 2022
@ghost ghost assigned tnorling Oct 13, 2022
@tnorling
Copy link
Collaborator

@diamant-isufi-sveasolar Are you sure it isn't hitting login.microsoftonline.com and then immediately redirecting back to your app? In cases where you already have an active session with AAD you may be redirected back without interacting with the page. Try collecting some network logs to confirm.

@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 Oct 13, 2022
@diamant-isufi-sveasolar
Copy link
Author

@tnorling it does go to https://login.microsoftonline.com, but then it redirects me back to my app inside the popup, so it doesn't close.

@ghost ghost added Needs: Attention 👋 Awaiting response from the MSAL.js team and removed Needs: Author Feedback Awaiting response from issue author labels Oct 14, 2022
@tnorling
Copy link
Collaborator

Does the url of the popup include the #code= or has the hash been stripped off?

@ghost ghost added Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels Oct 14, 2022
@tnorling tnorling assigned sameerag and unassigned tnorling Oct 17, 2022
@diamant-isufi-sveasolar
Copy link
Author

@tnorling The login.microsoftonline route opens up, it then redirects me back to the web route, but fails to close.. I am then stuck in the popup having the route that should be in the browser. This is a screenshot of the logs

image

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

ghost commented Oct 24, 2022

This issue requires attention from the MSAL.js team and has not seen activity in 5 days. @sameerag please follow up.

@bmahall
Copy link
Contributor

bmahall commented Oct 31, 2022

@diamant-isufi-sveasolar What are you using as authority in the authConfig? Is it a multi-tenant application
?

@ghost ghost added Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels Oct 31, 2022
@sameerag sameerag removed their assignment Oct 31, 2022
@hectormmg hectormmg self-assigned this Oct 31, 2022
@hectormmg
Copy link
Member

@diamant-isufi-sveasolar this should be fixed in version 2.30.0, please upgrade and let us know.

@ghost
Copy link

ghost commented Nov 7, 2022

@diamant-isufi-sveasolar 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.

@ghost ghost added the no-issue-activity Issue author has not responded in 5 days label Nov 7, 2022
@ghost ghost closed this as completed Nov 14, 2022
This issue was closed.
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" 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

5 participants