Authenticating via Microsoft Azure AD in Cypress (and Puppeteer)

Colin Wren
3 min readFeb 25, 2023

Recently I found myself having to automate a Single Sign On (SSO) implementation that used Microsoft Azure AD as the indentity provider and encountered some issues which I thought were worth sharing.

It’s worth noting that what I’m about to describe is an anti-pattern in Cypress, they recommend not automating 3rd party systems, instead using stubs or mock services but I found myself having to perform an end-to-end system test to cover the SSO implementation.

How does SSO with Azure work?

--

--

Colin Wren

Currently building reciprocal.dev. Interested in building shared understanding, Automated Testing, Dev practises, Metal, Chiptune. All views my own.