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

cy.origin() failed to create a spec bridge to communicate with the specified origin. This can happen when you attempt to create a spec bridge to an insecure (http) frame from a secure (https) frame. #30398

Closed
abdul-saboor-datics opened this issue Oct 11, 2024 · 1 comment
Labels
type: duplicate This issue or pull request already exists

Comments

@abdul-saboor-datics
Copy link

Current behavior

i am facing this issue while autherticating cypress with auth0 as per provided documentation.

issue
cy.origin() failed to create a spec bridge to communicate with the specified origin. This can happen when you attempt to create a spec bridge to an insecure (http) frame from a secure (https) frame.

Desired behavior

it should be logged in into my web app.

Test code to reproduce

function loginViaAuth0Ui(username, password) {

cy.visit('/');

cy.origin(
    Cypress.env('AUTH0_DOMAIN'),
    { args: { username, password } },
    ({ username, password }) => {
        cy.get('input#username').type(username);
        cy.get('input#password').type(password, { log: false });
        cy.contains('button[value=default]', 'Continue').click();
    }
);

cy.url().should('include', Cypress.config('baseUrl'));

}

Cypress.Commands.add('loginToAuth0', (username, password) => {
const log = Cypress.log({
displayName: 'AUTH0 LOGIN',
message: [🔐 Authenticating | ${username}],
autoEnd: false,
});
log.snapshot('before');

cy.session(
    `auth0-${username}`,
    () => {
        loginViaAuth0Ui(username, password);
    },
    {
        validate: () => {
            cy.wrap(localStorage)
              .invoke('getItem', 'authToken')
              .should('exist');
        },
    }
);

log.snapshot('after');
log.end();

});

Cypress Version

13.11.0

Node version

v16.20.2

Operating System

Windows Feature Experience Pack 1000.22700.1034.0

Debug Logs

No response

Other

No response

@jennifer-shehane
Copy link
Member

Duplicate of #28284

@jennifer-shehane jennifer-shehane marked this as a duplicate of #28284 Oct 11, 2024
@jennifer-shehane jennifer-shehane closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
@jennifer-shehane jennifer-shehane added the type: duplicate This issue or pull request already exists label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants