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

login with AAD with clientCertificate seems not working #30905

Open
MichaelMaIkea opened this issue Jan 17, 2025 · 4 comments
Open

login with AAD with clientCertificate seems not working #30905

MichaelMaIkea opened this issue Jan 17, 2025 · 4 comments
Labels
stage: awaiting response Potential fix was proposed; awaiting response

Comments

@MichaelMaIkea
Copy link

Current behavior

Recently our company migrate from Auth0 to EntraID, it gives problem for our e2e test.

We follow your guide Azure Active Directory Authentication and also config the certificate in the config file from doc Client Certificates
But still when login we got

Image

I am not sure what could be problem here. Could it be our test AAD account issue?
our Security department mentioned the account is indeed in the risky list.

Desired behavior

No response

Test code to reproduce

  cy.origin(
    'login.microsoftonline.com',
    {
      args: {
        user,
        password,
      },
    },
    ({ user, password }) => {
      cy.get('input[type="email"]').type(user || Cypress.env('auth_username'), {
        log: false,
      });
      cy.get('input[type="submit"]').click();
      cy.get('input[type="password"]').type(password || Cypress.env('auth_password'), {
        log: false,
      });
      cy.get('input[type="submit"]').click();
    },
  );

Cypress Version

13.13.2

Node version

v20.10.0

Operating System

macOS 14.5

Debug Logs

Other

No response

@jennifer-shehane
Copy link
Member

@MichaelMaIkea Could you try Cypress 14.0.0? That update includes some updates that should resolve some issues around login, but upgrading will help confirm if it’s related.

@jennifer-shehane jennifer-shehane added the stage: awaiting response Potential fix was proposed; awaiting response label Jan 17, 2025
@MichaelMaIkea
Copy link
Author

MichaelMaIkea commented Jan 20, 2025

I've upgraded to [email protected] , but I still got the same error.

So after I config the certificates, is this part still necessary or need some adaptation ?

cy.origin(
        'login.microsoftonline.com',
        {
          args: {
            user,
            password,
          },
        },
        ({ user, password }) => {
          cy.get('input[type="email"]').type(user || Cypress.env('auth_username'), {
            log: false,
          });
          cy.get('input[type="submit"]').click();
          cy.get('input[type="password"]').type(password || Cypress.env('auth_password'), {
            log: false,
          });
          cy.get('input[type="submit"]').click();
        },
      );

@MichaelMaIkea
Copy link
Author

It seems, the cypres can not select the certificate and the "Certificate validation failed" pops up.

@MichaelMaIkea
Copy link
Author

I manage to test the certificate and private key with Chrome, but I don't think Cypress can manage to select the certificate from the popup window of the certificate right?

Image

so
cy.get('a[id="idA_PWD_SwitchToCertificate"]').click(); won't work.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: awaiting response Potential fix was proposed; awaiting response
Projects
None yet
Development

No branches or pull requests

2 participants