Skip to content

[Bug]: Firefox - Windows SSO not working when preference enabled (network.http.windows-sso.enabled) #29844

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

Closed
AndrewRiggs-Atkins opened this issue Mar 7, 2024 · 2 comments

Comments

@AndrewRiggs-Atkins
Copy link

Version

1.42.1

Steps to reproduce

  1. Configure Playwright to use Firefox with SSO setting enabled.
projects: [
    {
      name: "Firefox",
      use: {
        browserName: "firefox",
        launchOptions: {
          firefoxUserPrefs: {
            "network.http.windows-sso.enabled": true,
          },
        },
      },
    },
  1. Create a simple Playwright test to go to https://login.microsoftonline.com/ to verify that the Windows SSO is working correctly, the account should be logged in or selectable if working.
import { test } from "@playwright/test";

test("Microsoft SSO", async ({ page }) => {

  // Go to Microsoft SSO sign-in page and wait for page to load
  await page.goto("https://login.microsoftonline.com/", {
    waitUntil: "domcontentloaded",
  });

  // Wait for long time to allow user to check about:config and security settings.
  await page.waitForTimeout(999999999);
}
  1. When the test runs and https://login.microsoftonline.com/ loads, if SSO is working correctly then the account should automatically be logged in or if multiple accounts exist there should be an option to select one of.

  2. Go to about:preferences#privacy, the setting Allow Windows single sign-on for Microsoft, work, and school accounts should be enabled.

  3. Go to about:config and search for network.http.windows-sso.enabled, it should be set to true.

Expected behavior

  1. Following navigation to https://login.microsoftonline.com/, if only one account is setup the user should be logged in automatically and redirected to https://office.com.

selenium-firefox-sso

Note: The above working example screen recording has been achieved by using Python Selenium and the Geckodriover (see Python code below to replicate).

import time
from selenium import webdriver
from selenium.webdriver.firefox.options import Options

# Set Firefox SSO preference
opts = Options()
opts.set_preference("network.http.windows-sso.enabled", True)

# Launch Firefox webdriver with SSO option
driver = webdriver.Firefox(options=opts)

# Navigate to Microsoft SSO login
driver.get("https://login.microsoftonline.com/")

# Wait for long time to allow user to check about:config and security settings.
time.sleep(999999)

Actual behavior

  1. Following navigation to https://login.microsoftonline.com/ there is no automatic SSO login or accounts available for selection.

image

  1. Additionally when you manually proceed through the login process, the device does not meet management compliance policy (this does not occur with Selenium or manual launching of Firefox).

image

  1. Checking about:preferences#privacy it can be seen that the SSO setting is enabled.

image

  1. Checking about:config it can be seen that the preference is enabled as per the Playwright Firefox configuration.

image

Additional context

  1. Manually launching the Firefox executable installed by Playwright (located at AppData\Local\ms-playwright\firefox-1440\firefox on Windows) the SSO works as expected when the preference is enabled.

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Memory: 10.71 GB / 31.88 GB
  Binaries:
    Node: 18.15.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.85.2 - C:\Users\<USER>\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 4.4.19 - C:\WINDOWS\system32\bash.EXE
  npmPackages:
    @playwright/test: ^1.42.1 => 1.42.1
@pavelfeldman
Copy link
Member

Why was this issue closed?

Thank you for your contribution to our project. This issue has been closed due to its limited upvotes and recent activity, and insufficient feedback for us to effectively act upon. Our priority is to focus on bugs that reflect higher user engagement and have actionable feedback, to ensure our bug database stays manageable.

Should you feel this closure was in error, please create a new issue and reference this one. We're open to revisiting it given increased support or additional clarity. Your understanding and cooperation are greatly appreciated.

@brnbtt
Copy link

brnbtt commented Nov 15, 2024

I don't understand how this got closed without any solution, I still have this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants