Loading...

Automating M365 login with MFA in Playwright tests

Automating M365 login with MFA in Playwright tests
I have been using Playwright to automate my tests for a long time, but one thing I struggled with was automating the login flow for Microsoft 365 with a multi-factor authentication (MFA) account. When using an MFA-enabled account, you must provide an additional manual step to complete the login process.

Published on:

Learn more
Elio Struyf - Office Development MVP
Elio Struyf - Office Development MVP

Microsoft 365 / SharePoint / Search / Development / Branding / Speaker / Blogger

Share post:

Related posts

Automating Microsoft 365 with PowerShell June 2026 Update

Version 24 of the Automating Microsoft 365 with PowerShell eBook is now available for current subscribers to download. The updated PDF and EPU...

23 minutes ago

Microsoft 365 & Power Platform Call (Microsoft Speakers) – May 19th, 2026 – Screenshot Summary

Call Highlights   SharePoint Quicklinks: Primary PnP Website: https://aka.ms/m365pnp Documentation & Guidance SharePoint Dev Videos Issues...

15 hours ago

Update to agents in SharePoint: Simpler launch experience and new site AI settings

SharePoint updates simplify agent management with new Site AI settings, letting site owners control highlighted agents. Approved agents won’t ...

22 hours ago

SharePoint Pages: Heading 1 (H1) option now available in web part title areas

SharePoint Pages will add Heading 1 (H1) as an optional heading level in web part title areas to enhance accessibility and semantic structure....

22 hours ago

Microsoft Copilot Studio – Classic agent creation moves from Teams to web experience, retiring June 30, 2026

Classic agent creation in Microsoft Copilot Studio is moving from the Teams app to the web app, retiring Teams-based creation on June 30, 2026...

22 hours ago

Microsoft Viva Copilot Analytics: Daily Copilot usage snapshot with near real-time data

Microsoft Viva Insights is introducing a new Power BI report, “Microsoft 365 Copilot latest usage snapshot,” providing daily updat...

22 hours ago

Microsoft Purview: Data Lifecycle Management – Insights and policy recommendations on sensitive M365 data for better Data Security and Compliance posture

Insights on sensitive M365 data (OneDrive and SharePoint) and recommendations on retention policies for customers to better govern their sensi...

23 hours ago

Microsoft Purview: Data Lifecycle Management – Archive OneDrive and SharePoint files under retention

Retention based file archiving moves inactive content to low-cost storage, lowering costs with no compromise on Compliance, keeping data disco...

23 hours ago

Microsoft Copilot (Microsoft 365): Work IQ APIs: Researcher Agent Access

Allows developers to invoke the Researcher agent through the Work IQ endpoint to perform multi‑step analysis, deep reasoning, and synthesis ac...

23 hours ago

Microsoft Teams: Support human interpreter listening mode in Microsoft Teams Rooms on Windows

Microsoft Teams Rooms on Windows now supports human interpreter listening mode in meetings where organizers enable language interpretation in ...

23 hours ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy