DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.82k stars 673 forks source link

Failure to redirect after authentication through Okta #7173

Closed andrewlw89 closed 1 year ago

andrewlw89 commented 3 years ago

What is your Scenario?

I am trying to log into a web application that is using Okta oauth2 authentication.

What is the Current behavior?

After successfully authenticating through Okta, the user is redirected back to the original login page at https://oktaqa.iloveasinsflywheel.com/#/auth/login and is not logged in.

What is the Expected behavior?

After successfully authenticating through Okta, the user is redirected to the root of the application, the authentication token is detected, and the application redirects on to https://oktaqa.iloveasinsflywheel.com/#/home.

What is your public website URL? (or attach your complete example)

https://oktaqa.iloveasinsflywheel.com

What is your TestCafe test code?

Not needed. This is easily recreated using only the Hammerhead HTTP Playground.

Your complete configuration file

No response

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

  1. Navigate to https://oktaqa.iloveasinsflywheel.com/
  2. Enter username and password in the correct form fields (to be sent over via email)
  3. Click login button

TestCafe version

1.17.0

Node.js version

v12.18.4

Command-line arguments

N/A. Suggest using the hammerhead HTTP playground.

Browser name(s) and version(s)

Chrome 95

Platform(s) and version(s)

macOS 11.5

Other

No response

Farfurix commented 3 years ago

@andrewlw89

Hello,

I reproduced this issue with Windows 10 and TestCafe 1.17.1. We'll update this thread once we have any news.

For the team:

import { Selector, Role } from 'testcafe';

fixture `Fixture`
    .page('https://oktaqa.iloveasinsflywheel.com/#/auth/login');

const loginInput   = Selector('input[name="username"]');
const passInput    = Selector('input[name="password"]');
const submitButton = Selector('#okta-signin-submit');

const username = '++++++++';
const pass     = '++++++++';

test('test', async t => {
    await t
        .typeText(loginInput, username)
        .typeText(passInput, pass);

    await t.click(submitButton);

    await t.debug();

    await t.navigateTo('https://oktaqa.iloveasinsflywheel.com');

    await t.debug();
});

test('test role', async t => { // use the --disable-page-caching flag
    const user = Role('https://oktaqa.iloveasinsflywheel.com/#/auth/login', async t => {
        await t
            .typeText(loginInput, username)
            .typeText(passInput, pass)
            .click(submitButton);
    }, { preserveUrl: true });

    await t.useRole(user);

    await t.debug();

    await t.navigateTo('https://oktaqa.iloveasinsflywheel.com');

    await t.debug();
});
andrewlw89 commented 2 years ago

Just wondering if there's any update or ETA on when this may see some progress? Thanks.

github-actions[bot] commented 2 years ago

Any personal estimate may be misleading, so we cannot currently tell it at the moment. Once we get any results, we will post them in this thread.

Artem-Babich commented 1 year ago

Hi @andrewlw89,

I just tried reproducing this issue with the latest testcafe version, however, it looks like your test credentials are no longer valid. Would you please share updated credentials for testing or test this case yourself using TestCafe v2.3.0-rc.2 with the experimental-proxyless option enabled?

github-actions[bot] commented 1 year ago

This issue was automatically closed because there was no response to our request for more information from the original author. Currently, we don't have enough information to take action. Please reach out to us if you find the necessary information and are able to share it. We are also eager to know if you resolved the issue on your own and can share your findings with everyone.