Examples of UsernamePrincipal


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

        }

        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

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

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

        }

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

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

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

                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.sasl.UsernamePrincipal

        }

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

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

                                                          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

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

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

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

            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

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

        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

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

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

            if (server.isComplete())
            {
                final Subject subject = new Subject();
                subject.getPrincipals().add(new UsernamePrincipal(server.getAuthorizationID()));
                return new AuthenticationResult(subject);
            }
            else
            {
                return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.CONTINUE);
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.