Bypass blocking of subresource requests whose URLs contain embedded credentials

Viewed 21309

I have been automatically authenticating users visiting our internal wiki via a link with a token in the URL like this:

href="https://user:pass@host/"

In Chrome 59, this is being prevented.

[Deprecation] Subresource requests whose URLs contain embedded credentials (e.g. https://user:pass@host/) are blocked.

I read and I bypassed it in an ajax request like this:

how to replace embedded credentials in subresource requests

========================================================================

My Question is:

Does anyone know how to do it directly in the link, or can you provide some kind of workaround? Is this even possible?

3 Answers

To handle this, we have to pass chrome options : "--disable-blink-features=BlockCredentialedSubresources");

Complete code is mentioned below :

ChromeOptions options = new ChromeOptions();
        options.addArguments("--start-maximized");
        options.addArguments("--disable-blink-features=BlockCredentialedSubresources");

        Map<String, Object> prefs = new HashMap<String, Object>();
        prefs.put("credentials_enable_service", false);
        prefs.put("profile.password_manager_enabled", false);
        options.setExperimentalOption("prefs", prefs);

        DesiredCapabilities capabilities = DesiredCapabilities.chrome();
        capabilities.setCapability(ChromeOptions.CAPABILITY, options);
        driver = new ChromeDriver(capabilities);
Related