question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect redirect to malformed url within AUT - adding `_/` in url

See original GitHub issue

Current behavior:

When I instruct cypress to login to an Oracle APEX application, the authentication re-directs cypress to a ‘404 not found’ page because the authenticated URL is malformed. The malformed URL is the only issue and can simply corrected programmatically (with a find and replace command). Screen Shot 2019-04-15 at 10 14 48 PM

However - it is very important to note that the cypress login correctly returns:

  1. a valid cookie
  2. a valid session

which is everything you need for authentication.

Desired behavior:

Cypress, ideally, should be able to follow the same authentication redirect that a user would in a regular browser.

Steps to reproduce: (app code and test code)

I created a dummy application with dummy credentials hosted by apex.oracle.com to demonstrate:

it('Login demo', function() {
    cy.visit('https://apex.oracle.com/pls/apex/f?p=54707:LOGIN_DESKTOP')
    cy.get('#P9999_USERNAME').type('ApexUser')
    cy.get('#P9999_PASSWORD').type('Oradoc_db1')
    cy.get('.t-Button').click()
  })

The above code (which should work until the application expires in many months) will redirect to a 404 not found page with a url in the format: https://apex.oracle.com/__/f?p=54707:1:[session_id]::::: Outside of cypress the url will have the format: https://apex.oracle.com/pls/apex/f?p=54707:1:[session_id]:::::

Versions

I have tested this across 4 instances of Oracle APEX (APEX 5.0, 5.1, 18.1 and 19) and this behavior is consistent.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:53 (22 by maintainers)

github_iconTop GitHub Comments

4reactions
Yann39commented, Sep 2, 2020

I am also facing this issue with all browsers including Electron :

  • Electron
  • Edge 85 (85.0.564.41)
  • Chrome 85 (85.0.4183.83)
  • Firefox 80 (beta)

Cypress 4.7.0 Node v8.11.3

Same after upgrading to latest versions: Cypress 5.1.0 Node v12.18.3

it('Login page', () => {

        // visit main home page
        cy.visit('https://tstapex.myhost.ch/ords/f?p=119')

        // make sure we are redirected to login
        cy.url().should('include', 'LOGIN_DESKTOP')

        // log in
        cy.get('#P9999_USERNAME').type('username')
        cy.get('#P9999_PASSWORD').type('password')

        // click login button
        cy.get('#login-button').click();

    })

I’m redirected to https://tstapex.myhost.ch/__/f?p=119:1:28275213605974:::::

Then of course get:

Not Found The requested URL /__/f was not found on this server.

Setting experimentalSourceRewriting to true does not help.

3reactions
jennifer-shehanecommented, Dec 6, 2019

There is an open PR meant to fix this here: https://github.com/cypress-io/cypress/pull/5273 It’s complicated and is still a work in progress.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Receiving a "redirect_uri_mismatch" error when aut...
I think the issue may be that when you have created your API key you set the URL redirect to a certain point...
Read more >
Google OAuth, after successful sign in, redirects to a ...
After successful OAuth sign in, google redirects to the URL with the state and scope queryparam without encoding, such as the one mentioned ......
Read more >
HCL Notes/Domino - How to redirect a malformed url
1) Create a html file with below content. <! · 2) Save the file with name "response.html" · 3) Place this file in...
Read more >
HTTP status and error codes for JSON | Cloud Storage
When downloading content from a cookie-authenticated site, e.g., using the Storage Browser, the response will redirect to a temporary domain. This error will ......
Read more >
Recent Vulnerability in next-auth (CVE-2022-31093) - Vulert
Improper Handling of `callbackUrl` parameter in next-auth ... The URL instantiation would fail due to a malformed URL being passed into the constructor, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found