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

Trying to login with Auth0 seems to get stuck and not redirect back to app #18208

Closed
purejgleason opened this issue Sep 22, 2021 · 1 comment
Closed

Comments

@purejgleason
Copy link

purejgleason commented Sep 22, 2021

Current behavior

Gets stuck at https://<auth0domain>/authorize/resume when trying to log in using Auth0 OpenID connect with session cypress

Desired behavior

It should allow me to fully complete the Oauth and end up at the callback url

Test code to reproduce

I have a working app that uses Auth0 for authentication. In the workflow the user visits http://site/login and they are redirected to the auth0 domain for the login popup. Once logged in it should be forwarded back to http://site/callback. However, when I have this as my test

const fillLogin = async () => {
  await cy.visit(baseUrl);
  cy.log("Filling login");
  cy.get("#username")
    .should("be.visible")
    .type("...");
  cy.get("#password")
    .should("be.visible")
    .type("...");
  cy.get("button[name=\"action\"]")
    .should("be.visible")
    .click();
  await cy.visit(baseUrl);
  return cy.get(".main-container")
    .should("be.visible");
};

It fills out everything and then clicks the button but when it is redirected it gets stuck at https://<auth0domain>/authorize/resume. If I try reloading with await cy.visit(baseUrl); I get...

cy.visit() failed because you are attempting to visit a URL that is of a different origin.

Cypress Version

^8.4.1

Other

No response

@jennifer-shehane
Copy link
Member

You can't currently visit another url that is of a different origin within a single test. We're currently working on supporting this. Duplicate of #17336

There are many guides online showing ways to test with Auth0 through verifying the API calls that you should reference to write this test in a programmatic way until that is delivered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants