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

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


            }

            @Override
            public Principal getAuthenticatedPrincipal(SaslServer server)
            {
                return new UsernamePrincipal(server.getAuthorizationID());
            }
        };
    }
View Full Code Here


            Principal username = null;
            for (Callback callback : callbacks)
            {
                if (callback instanceof NameCallback)
                {
                    username = new UsernamePrincipal(((NameCallback) callback).getDefaultName());
                }
                else if (callback instanceof PasswordCallback)
                {
                    try
                    {
View Full Code Here

                if(LOGGER.isDebugEnabled())
                {
                    LOGGER.debug("Constructing Principal with username: " + username);
                }
                return new UsernamePrincipal(username);
            }
            else
            {
                // No CN => Cannot construct username => Authentication failed => return null
                if(LOGGER.isDebugEnabled())
View Full Code Here

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

        final String groupFileName = writeGroupFile();
        _manager = new FileGroupManager(groupFileName);
        _manager.open();
        Set<Principal> principals = _manager.getUserPrincipalsForGroup("myGroup");
        assertEquals(1, principals.size());
        assertTrue(principals.contains(new UsernamePrincipal("user1")));
    }
View Full Code Here

        final String groupFileName = writeGroupFile(MY_GROUP, MYGROUP_USERS);
        _manager = new FileGroupManager(groupFileName);
        _manager.open();
        Set<Principal> principals = _manager.getUserPrincipalsForGroup("myGroup");
        assertEquals(1, principals.size());
        assertFalse(principals.contains(new UsernamePrincipal("user2")));

        _manager.addUserToGroup("user2", "myGroup");

        principals = _manager.getUserPrincipalsForGroup("myGroup");
        assertEquals(2, principals.size());
        assertTrue(principals.contains(new UsernamePrincipal("user2")));
    }
View Full Code Here

        final String groupFileName = writeGroupFile(MY_GROUP, MYGROUP_USERS);
        _manager = new FileGroupManager(groupFileName);
        _manager.open();
        Set<Principal> principals = _manager.getUserPrincipalsForGroup("myGroup");
        assertEquals(1, principals.size());
        assertTrue(principals.contains(new UsernamePrincipal("user1")));

        _manager.removeUserFromGroup("user1", "myGroup");

        principals = _manager.getUserPrincipalsForGroup("myGroup");
        assertEquals(0, principals.size());
View Full Code Here

    }

    @Override
    public AuthenticationResult authenticate(String username, String password)
    {
        return new AuthenticationResult(new UsernamePrincipal(username));
    }
View Full Code Here

            // Process response from the client
            byte[] challenge = server.evaluateResponse(response != null ? response : new byte[0]);

            if (server.isComplete())
            {
                return new AuthenticationResult(new UsernamePrincipal(server.getAuthorizationID()));
            }
            else
            {
                return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.CONTINUE);
            }
View Full Code Here

            if (server.isComplete())
            {
                String authorizationID = server.getAuthorizationID();
                _logger.debug("Authenticated as " + authorizationID);

                return new AuthenticationResult(new UsernamePrincipal(authorizationID));
            }
            else
            {
                return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.CONTINUE);
            }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.security.auth.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.