Examples of UsernamePrincipal


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

        try
        {
            if (_principalDatabase.verifyPassword(username, password.toCharArray()))
            {
                final Subject subject = new Subject();
                subject.getPrincipals().add(new UsernamePrincipal(username));
                return new AuthenticationResult(subject);
            }
            else
            {
                return new AuthenticationResult(AuthenticationStatus.CONTINUE);
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

    public boolean setPassword(String username, char[] password)
    {
        try
        {
            //delegate password changes to the Principal Database
            return _principalDatabase.updatePassword(new UsernamePrincipal(username), password);
        }
        catch (AccountNotFoundException e)
        {
            _logger.warn("Attempt to set password of non-existent user'" + username + "'");
            return false;
View Full Code Here

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

        throw new UnsupportedOperationException("Support for setting access rights no longer supported.");
    }
   
    public boolean createUser(String username, String password)
    {
        if (_principalDatabase.createPrincipal(new UsernamePrincipal(username), password.toCharArray()))
        {
            return true;
        }

        return false;
View Full Code Here

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

    public boolean deleteUser(String username)
    {
        try
        {
            _principalDatabase.deletePrincipal(new UsernamePrincipal(username));
        }
        catch (AccountNotFoundException e)
        {
            _logger.warn("Attempt to delete user (" + username + ") that doesn't exist");
            return false;
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

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

        try
        {
            if (db.verifyPassword(username, password.toCharArray()))
            {
                final Subject subject = new Subject();
                subject.getPrincipals().add(new UsernamePrincipal(username));
                return new AuthenticationResult(subject);
            }
            else
            {
                return new AuthenticationResult(AuthenticationStatus.CONTINUE);
View Full Code Here

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

                ConnectionTuneBody tuneBody =
                        methodRegistry.createConnectionTuneBody(ApplicationRegistry.getInstance().getConfiguration().getMaxChannelCount(),
                                                                ConnectionStartOkMethodHandler.getConfiguredFrameSize(),
                                                                ApplicationRegistry.getInstance().getConfiguration().getHeartBeatDelay());
                session.writeFrame(tuneBody.generateFrame(0));
                final UsernamePrincipal principal = UsernamePrincipal.getUsernamePrincipalFromSubject(authResult.getSubject());
                session.setAuthorizedID(principal);
                disposeSaslServer(session);               
                break;
            case CONTINUE:
                stateManager.changeState(AMQState.CONNECTION_NOT_AUTH);
View Full Code Here

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

                    disposeSaslServer(session);
                    break;

                case SUCCESS:
                    _logger.info("Connected as: " + ss.getAuthorizationID());
                    session.setAuthorizedID(new UsernamePrincipal(ss.getAuthorizationID()));

                    stateManager.changeState(AMQState.CONNECTION_NOT_TUNED);

                    ConnectionTuneBody tuneBody = methodRegistry.createConnectionTuneBody(ApplicationRegistry.getInstance().getConfiguration().getMaxChannelCount(),
                                                                                          getConfiguredFrameSize(),
View Full Code Here

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

        _principal.set(principal);
    }

    public static void setThreadPrincipal(String authId)
    {
        setThreadPrincipal(new UsernamePrincipal(authId));
    }
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.