Examples of UsernamePrincipal


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

            byte[] challenge = server.evaluateResponse(response != null ? response : new byte[0]);

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

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

    {
        try
        {
            if (_principalDatabase.verifyPassword(username, password.toCharArray()))
            {
                return new AuthenticationResult(new UsernamePrincipal(username));
            }
            else
            {
                return new AuthenticationResult(AuthenticationStatus.CONTINUE);
            }
View Full Code Here

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

    }

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

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

            // 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

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

            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

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

        @Override
        public boolean createUser(String username, String password, Map<String, String> attributes)
        {
            if(getSecurityManager().authoriseUserOperation(Operation.CREATE, username))
            {
                return getPrincipalDatabase().createPrincipal(new UsernamePrincipal(username), password.toCharArray());
            }
            else
            {
                throw new AccessControlException("Do not have permission to create new user");
            }
View Full Code Here

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

        @Override
        public void deleteUser(String username) throws AccountNotFoundException
        {
            if(getSecurityManager().authoriseUserOperation(Operation.DELETE, username))
            {
                getPrincipalDatabase().deletePrincipal(new UsernamePrincipal(username));
            }
            else
            {
                throw new AccessControlException("Cannot delete user " + username);
            }
View Full Code Here

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

        @Override
        public void setPassword(String username, String password) throws AccountNotFoundException
        {
            if(getSecurityManager().authoriseUserOperation(Operation.UPDATE, username))
            {
                getPrincipalDatabase().updatePassword(new UsernamePrincipal(username), password.toCharArray());
            }
            else
            {
                throw new AccessControlException("Do not have permission to set password");
            }
View Full Code Here

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

        {
            if(childClass == User.class)
            {
                String username = (String) attributes.get("name");
                String password = (String) attributes.get("password");
                Principal p = new UsernamePrincipal(username);

                if(createUser(username, password,null))
                {
                    @SuppressWarnings("unchecked")
                    C pricipalAdapter = (C) new PrincipalAdapter(p);
View Full Code Here

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

             */
            @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
TOP
Copyright © 2018 www.massapi.com. 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.