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 Against Microsoft Azure Active Directory in CICD Pipeline Failing #5542

Closed
6 tasks
whanso opened this issue Oct 20, 2023 · 1 comment
Closed
6 tasks

Comments

@whanso
Copy link

whanso commented Oct 20, 2023

Description

When I write a test that authenticates a user through Azure AD, I get error in my ADO pipeline (see below).

URL of Issue(s)

NA

Steps to replicate

  1. Write a test that visits your site and redirects an unauthenticated user to the Azure AD Login. Exact code used below, and follows the guide attached:
    https://docs.cypress.io/guides/end-to-end-testing/azure-active-directory-authentication#Login-with-cyorigin
// Login to your AAD tenant.
  cy.origin(
    'login.microsoftonline.com',
    {
      args: {
        username,
      },
    },
    ({ username }) => {
      cy.get('input[type="email"]').type(username, {
        log: false,
      })
      cy.get('input[type="submit"]').click()
    }
  )

  // depending on the user and how they are registered with Microsoft, the origin may go to live.com
  cy.origin(
    'login.live.com',
    {
      args: {
        password,
      },
    },
    ({ password }) => {
      cy.get('input[type="password"]').type(password, {
        log: false,
      })
      cy.get('input[type="submit"]').click()
      cy.get('#idBtn_Back').click()
    }
  )
  1. Run in pipeline
  2. See error
image Screenshot 2023-10-20 at 2 46 03 PM

I'm not able to replicate this locally using cypress run or conducting development within Cypress.app.

Cypress config:

{
reporter: 'mocha-multi-reporters',
  reporterOptions: {
    configFile: 'reporter-config.json',
  },
  fileServerFolder: 'dist',
  fixturesFolder: 'cypress/fixtures',
  projectId: 'yudf7a',
  chromeWebSecurity: false,
  experimentalModifyObstructiveThirdPartyCode: true,
  e2e: {
    baseUrl:<APP_URL>,
    specPattern: 'cypress/e2e/**/*.ts',
  },
  defaultCommandTimeout: 20000,`
}

I have tried:

  1. Sprinkling { force: true }.
  2. Adding cy.wait.
  3. Extending default timeout for Cypress commands in the config.

Has anyone else seen this problem?

Any help would be appreciated.

Browser

No response

Device

  • PC
  • Mac
  • iPhone
  • iPad
  • Android Phone
  • Android Tablet

Additional Information

No response

@whanso
Copy link
Author

whanso commented Oct 23, 2023

Closing this, non-issue. Our pipelines were not accessing library group variables because they were not configured, and the pipeline did not throw an exception for a variable that doesn't exist.

We learned a lot by publishing the video as a build artifact, downloading, and viewing on our local machine. Fixed it pretty quickly.

@whanso whanso closed this as completed Oct 23, 2023
@cypress-io cypress-io locked and limited conversation to collaborators Nov 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant