@Override
    public Credentials configure(final Host host) {
        if(WinHttpClients.isWinAuthAvailable()) {
            if(!host.getCredentials().validate(host.getProtocol(), new LoginOptions(host.getProtocol()).password(false))) {
                final String nameSamCompatible = CurrentWindowsCredentials.INSTANCE.getName();
                final Credentials credentials = new Credentials(host.getCredentials())
                        .withPassword(CurrentWindowsCredentials.INSTANCE.getPassword());
                if(!includeDomain && StringUtils.contains(nameSamCompatible, '\\')) {
                    credentials.setUsername(StringUtils.split(nameSamCompatible, '\\')[1]);
                }
                else {
                    credentials.setUsername(nameSamCompatible);
                }
                if(log.isDebugEnabled()) {
                    log.debug(String.format("Configure %s with username %s", host, credentials));
                }
                return credentials;
            }
        }
        return CredentialsConfigurator.DISABLED.configure(host);
    }
@Test
    public void testConfigure() {
        assumeTrue(Factory.Platform.getDefault().equals(Factory.Platform.Name.linux));
        final Host bookmark = new Host(new TestProtocol());
        assertSame(bookmark.getCredentials(), new WindowsIntegratedCredentialsConfigurator().configure(bookmark));
    }