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 and LoginRedirect not Working #7096

Closed
2 tasks
mahiradev opened this issue May 14, 2024 · 2 comments
Closed
2 tasks

LoginPopup and LoginRedirect not Working #7096

mahiradev opened this issue May 14, 2024 · 2 comments
Labels
b2c Related to Azure B2C library-specific issues 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 public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.

Comments

@mahiradev
Copy link

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

1.5.2

Wrapper Library

MSAL React (@azure/msal-react)

Wrapper Library Version

None

Public or Confidential Client?

Public

Description

I am using Azure msal for B2C Login
I am using loginPopup it is working fine
But when my App is redirecting from another App loginPopup i am getting my website url (www.example.com/sign-in) in popup
If i change loginPopup to loginRedirect() its redirecting to signin and Dashboard Continuously

Error Message

No response

MSAL Logs

No response

Network Trace (Preferrably Fiddler)

  • Sent
  • Pending

MSAL Configuration

export const msalConfig = {
   auth: {
       clientId: "clientId",
       authority: "tenantId",
       redirectUri: process.env.REACT_APP_REDIRECT_URI,
cache: {
        cacheLocation: "localStorage", // This configures where your cache will be stored
        storeAuthStateInCookie: true, // Set this to "true" if you are having issues on IE11 or Edge
    },
   },

Relevant Code Snippets

const handleLogin = () => {

        if (instance.getActiveAccount()) {
            // If already logged in, verify login and update form state
            console.log("its entering in to instance.getActiveAccount()",localStorage.length);
            const updatedValues = formState.values
            handleFormChange(updatedValues);
            verifLogin()
        }else{
            instance
            .loginPopup(loginRequest)
            .catch((error) => {
                console.error("Login error:", error);
            })
            .then(verifLogin);
            console.log(instance.setActiveAccount(account));
        }
       
    };

Reproduction Steps

Redirect from one app to another App

Expected Behavior

if I am redirecting from one app/website to another website without asking login Credentials.

Identity Provider

Azure B2C Basic Policy

Browsers Affected (Select all that apply)

Chrome

Regression

@azure/msal-react: "^1.5.2",

Source

Internal (Microsoft)

@mahiradev mahiradev 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 14, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label May 14, 2024
@github-actions github-actions bot added b2c Related to Azure B2C library-specific issues msal-browser Related to msal-browser package msal-react Related to @azure/msal-react public-client Issues regarding PublicClientApplications labels May 14, 2024
@tnorling
Copy link
Collaborator

Using another app's redirectUri is unsupported. The domain of the redirectUri must match the domain of the app which initiated the request.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: Attention 👋 Awaiting response from the MSAL.js team label May 20, 2024
@mahiradev
Copy link
Author

mahiradev commented May 21, 2024

@tnorling The problem is exactly www.example.com here i have one button if i am clicking the button www.example1.com it will open my website in this scenario LoginPopup is not working and in this version if i am implementing LoginRedirect instead of loginPopup its keep on loading no error no warning So basically its not redirecting while i am clicking the button its opening my website in this scenario my popup also not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b2c Related to Azure B2C library-specific issues 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 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