Package waffle.windows.auth.impl

Examples of waffle.windows.auth.impl.WindowsAuthProviderImpl


        }
    }

    synchronized void initialize() {
        if (initialized) return;
        provider = new WindowsAuthProviderImpl();
        afterInitialize(provider);
        initialized = true;
    }
View Full Code Here


    }

    @Override
    public void setup() {

        waffle = new WindowsAuthProviderImpl();
        IWindowsComputer computer = waffle.getCurrentComputer();
        logger.info("Windows Authentication Provider");
        logger.info("      name = " + computer.getComputerName());
        logger.info("    status = " + describeJoinStatus(computer.getJoinStatus()));
        logger.info("  memberOf = " + computer.getMemberOf());
View Full Code Here

                throw new ServletException(e);
            }
        }

        if (this.auth == null) {
            this.auth = new WindowsAuthProviderImpl();
        }

        if (providerNames != null) {
            this.providers = new SecurityFilterProviderCollection(providerNames, this.auth);
        }
View Full Code Here

    private NegotiateSecurityFilter filter;

    @Before
    public void setUp() throws ServletException {
        this.filter = new NegotiateSecurityFilter();
        this.filter.setAuth(new WindowsAuthProviderImpl());
        this.filter.init(null);
    }
View Full Code Here

public class SecurityFilterProviderCollectionTests {

    @Test
    public void testDefaultCollection() throws ClassNotFoundException {
        final SecurityFilterProviderCollection coll = new SecurityFilterProviderCollection(
                new WindowsAuthProviderImpl());
        assertEquals(2, coll.size());
        assertNotNull(coll.getByClassName(NegotiateSecurityFilterProvider.class.getName()));
        assertNotNull(coll.getByClassName(BasicSecurityFilterProvider.class.getName()));
    }
View Full Code Here

    }

    @Test(expected = ClassNotFoundException.class)
    public void testGetByClassNameInvalid() throws ClassNotFoundException {
        final SecurityFilterProviderCollection coll = new SecurityFilterProviderCollection(
                new WindowsAuthProviderImpl());
        coll.getByClassName("classDoesNotExist");
    }
View Full Code Here

    }

    @Test
    public void testIsSecurityPackageSupported() {
        final SecurityFilterProviderCollection coll = new SecurityFilterProviderCollection(
                new WindowsAuthProviderImpl());
        assertTrue(coll.isSecurityPackageSupported("NTLM"));
        assertTrue(coll.isSecurityPackageSupported("Negotiate"));
        assertTrue(coll.isSecurityPackageSupported("Basic"));
        assertFalse(coll.isSecurityPackageSupported(""));
        assertFalse(coll.isSecurityPackageSupported("Invalid"));
View Full Code Here

        return doc;
    }

    protected Element getAuthProviderInfo(final Document doc) {
        final IWindowsAuthProvider auth = new WindowsAuthProviderImpl();

        final Element node = doc.createElement("auth");
        node.setAttribute("class", auth.getClass().getName());

        // Current User
        Element child = doc.createElement("currentUser");
        node.appendChild(child);

        final String currentUsername = WindowsAccountImpl.getCurrentUsername();
        addAccountInfo(doc, child, new WindowsAccountImpl(currentUsername));

        // Computer
        child = doc.createElement("computer");
        node.appendChild(child);

        IWindowsComputer c = auth.getCurrentComputer();
        Element value = doc.createElement("computerName");
        value.setTextContent(c.getComputerName());
        child.appendChild(value);

        value = doc.createElement("memberOf");
        value.setTextContent(c.getMemberOf());
        child.appendChild(value);

        value = doc.createElement("joinStatus");
        value.setTextContent(c.getJoinStatus());
        child.appendChild(value);

        value = doc.createElement("groups");
        Element g;
        for (String s : c.getGroups()) {
            g = doc.createElement("group");
            g.setTextContent(s);
            value.appendChild(g);
        }
        child.appendChild(value);

        // Only Show Domains if we are in a Domain
        if (Netapi32Util.getJoinStatus() == LMJoin.NETSETUP_JOIN_STATUS.NetSetupDomainName) {
            child = doc.createElement("domains");
            node.appendChild(child);

            Element d;
            for (IWindowsDomain domain : auth.getDomains()) {
                d = doc.createElement("domain");
                node.appendChild(d);

                value = doc.createElement("FQN");
                value.setTextContent(domain.getFqn());
View Full Code Here

        value.setTextContent(account.getSidString());
        node.appendChild(value);
    }

    public Element getLookupInfo(final Document doc, final String lookup) {
        final IWindowsAuthProvider auth = new WindowsAuthProviderImpl();
        final Element node = doc.createElement("lookup");
        node.setAttribute("name", lookup);
        try {
            addAccountInfo(doc, node, auth.lookupAccount(lookup));
        } catch (Win32Exception ex) {
            node.appendChild(getException(doc, ex));
        }
        return node;
    }
View Full Code Here

    private int                     resultOfNetAddUser;

    @Before
    public void setUp() {
        this.filter = new NegotiateSecurityFilter();
        this.filter.setAuth(new WindowsAuthProviderImpl());
        try {
            this.filter.init(null);
        } catch (ServletException e) {
            fail(e.getMessage());
        }
View Full Code Here

TOP

Related Classes of waffle.windows.auth.impl.WindowsAuthProviderImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.