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

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


        }

        if(saslServer.isComplete())
        {
            final Subject subject = new Subject();
            subject.getPrincipals().add(new UsernamePrincipal(saslServer.getAuthorizationID()));
            session.setAttribute("subject", subject);
            session.removeAttribute(ATTR_ID);
            session.removeAttribute(ATTR_SASL_SERVER);
            session.removeAttribute(ATTR_EXPIRY);
View Full Code Here

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

        }

        @Override
        public boolean createUser(String username, String password, Map<String, String> attributes)
        {
            return getPrincipalDatabase().createPrincipal(new UsernamePrincipal(username), password.toCharArray());
        }
View Full Code Here

            if(getSecurityManager().authoriseMethod(Operation.DELETE,
                                                    "UserManagement",
                                                    "deleteUser"))
            {

                getPrincipalDatabase().deletePrincipal(new UsernamePrincipal(username));
            }
            else
            {
                throw new AccessControlException("Cannot delete user " + username);
            }
View Full Code Here

        }

        @Override
        public void setPassword(String username, String password) throws AccountNotFoundException
        {
            getPrincipalDatabase().updatePassword(new UsernamePrincipal(username), password.toCharArray());
        }
View Full Code Here

                                                          Map<String, Object> attributes,
                                                          ConfiguredObject... otherParents)
        {
            if(childClass == User.class)
            {
                Principal p = new UsernamePrincipal((String) attributes.get("name"));
                if(getSecurityManager().authoriseMethod(Operation.UPDATE, "UserManagement", "createUser"))
                {
                    if(getPrincipalDatabase().createPrincipal(p, ((String)attributes.get("password")).toCharArray()))
                    {
                        return (C) new PrincipalAdapter(p);
View Full Code Here

    public Principal getUser(String username)
    {
        if (_users.getProperty(username) != null)
        {
            return new UsernamePrincipal(username);
        }
        else
        {
            return null;
        }
View Full Code Here

            if (server.isComplete())
            {
                final Subject subject = new Subject();
                _logger.debug("Authenticated as " + server.getAuthorizationID());
                subject.getPrincipals().add(new UsernamePrincipal(server.getAuthorizationID()));
                return new AuthenticationResult(subject);
            }
            else
            {
                return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.CONTINUE);
View Full Code Here

        env.put(Context.SECURITY_PRINCIPAL, username);
        env.put(Context.SECURITY_CREDENTIALS, password);
        DirContext ctx = new InitialDirContext(env);
        ctx.close();
        final Subject subject = new Subject();
        subject.getPrincipals().add(new UsernamePrincipal(username));
        return new AuthenticationResult(subject);
    }
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.