Package org.apache.qpid.server.security.auth.sasl

Examples of org.apache.qpid.server.security.auth.sasl.UsernamePrincipal


    public Principal getUser(String username)
    {
        if (_userMap.containsKey(username))
        {
            return new UsernamePrincipal(username);
        }
        return null;
    }
View Full Code Here


             */
            @Override
            protected RMIConnection makeClient(String connectionId, Subject subject) throws IOException
            {
                final RMIConnection makeClient = super.makeClient(connectionId, subject);
                final UsernamePrincipal usernamePrincipalFromSubject = UsernamePrincipal.getUsernamePrincipalFromSubject(subject);
                connectionIdUsernameMap.put(connectionId, usernamePrincipalFromSubject.getName());
                return makeClient;
            }
        };

        // Create a Listener responsible for removing the map entries add by the #makeClient entry above.
View Full Code Here

    {
        SaslServer testServer = createTestSaslServer(true, false);
       
        AuthenticationResult result = _manager.authenticate(testServer, "12345".getBytes());
        final Subject subject = result.getSubject();
        assertTrue(subject.getPrincipals().contains(new UsernamePrincipal("guest")));
        assertEquals(AuthenticationStatus.SUCCESS, result.getStatus());
    }
View Full Code Here

    public void testNonSaslAuthenticationSuccess() throws Exception
    {
        AuthenticationResult result = _manager.authenticate("guest", "guest");
        final Subject subject = result.getSubject();
        assertFalse("Subject should not be set read-only", subject.isReadOnly());
        assertTrue(subject.getPrincipals().contains(new UsernamePrincipal("guest")));
        assertEquals(AuthenticationStatus.SUCCESS, result.getStatus());
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.security.auth.sasl.UsernamePrincipal

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.