Prevent SSO with Playwright

So…..after some more digging, after asking the correct question, which in the end was:

“How to disable Windows Integrated Authentication in Chrome?”

I found this checklist for conditions and this answer on SO.

The fix was to add a startup arg to chromium to disable WIA. Here’s the important bit below:

browser = await chromium.launch({
            args: ['--auth-server-whitelist="_"'],

This will make chrome present a basic auth prompt for credentials.

However, when I combined this with the custom userAgent string that is not amongst the useragents supported by the ADFS server, I managed to reach the login page of ADFS.

Again, OperaMini worked for me:

context = await browser.newContext({
        userAgent: 'Opera/9.80 (Android; Opera Mini/12.0.1987/37.7327; U; pl) Presto/2.12.423 Version/12.16'

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top