Examples of AuthenticatedPrincipal


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

    @Override
    protected void setUp() throws Exception
    {
        super.setUp();

        _subject.getPrincipals().add(new AuthenticatedPrincipal("mockusername"));
        _loginLogoutReport = new LoginLogoutReporter(_logActor, _subject);
    }
View Full Code Here

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

            return;
        }

        if(saslServer.isComplete())
        {
            Subject originalSubject = subjectCreator.createSubjectWithGroups(new AuthenticatedPrincipal(saslServer.getAuthorizationID()));
            Subject subject = new Subject(false,
                                          originalSubject.getPrincipals(),
                                          originalSubject.getPublicCredentials(),
                                          originalSubject.getPrivateCredentials());
            subject.getPrincipals().add(new ServletConnectionPrincipal(request));
View Full Code Here

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

                    username = SSLUtil.getIdFromSubjectDN(dn);
                    principal = new  UsernamePrincipal(username);
                }

                subject = subjectCreator.createSubjectWithGroups(new AuthenticatedPrincipal(principal));
            }
        }
        else
        {
            String header = request.getHeader("Authorization");
View Full Code Here

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

                    username = SSLUtil.getIdFromSubjectDN(dn);
                    principal = new  UsernamePrincipal(username);
                }

                subject = subjectCreator.createSubjectWithGroups(new AuthenticatedPrincipal(principal));
            }
        }
        else
        {
            String header = request.getHeader("Authorization");
View Full Code Here

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

        Subject subject = _usernameAccessor.getSubjectConnectionId(connectionId);
        if(subject == null)
        {
            subject = new Subject();
        }
        AuthenticatedPrincipal authenticatedPrincipal =
                AuthenticatedPrincipal.getOptionalAuthenticatedPrincipalFromSubject(subject);

        String user;

        if(authenticatedPrincipal != null)
        {
            user = authenticatedPrincipal.getName();
        }
        else
        {
            // If user is still null, fallback to an unordered list of Principals from the connection id.
            final String[] splitConnectionId = connectionId.split(" ");
View Full Code Here

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

    }

    public static AuthenticatedPrincipal getCurrentUser()
    {
        Subject subject = Subject.getSubject(AccessController.getContext());
        final AuthenticatedPrincipal user;
        if(subject != null)
        {
            Set<AuthenticatedPrincipal> principals = subject.getPrincipals(AuthenticatedPrincipal.class);
            if(principals != null && !principals.isEmpty())
            {
View Full Code Here

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

    public Subject createSubjectWithGroups(String username)
    {
        Subject authenticationSubject = new Subject();

        authenticationSubject.getPrincipals().add(new AuthenticatedPrincipal(username));
        authenticationSubject.getPrincipals().addAll(getGroupPrincipals(username));
        authenticationSubject.setReadOnly();

        return authenticationSubject;
    }
View Full Code Here

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

        else if(_exclusivityPolicy == ExclusivityPolicy.PRINCIPAL)
        {
            String owner = MapValueConverter.getStringAttribute(Queue.OWNER, attributes, null);
            if(owner != null)
            {
                _exclusiveOwner = new AuthenticatedPrincipal(owner);
            }
        }
        else if(_exclusivityPolicy == ExclusivityPolicy.CONTAINER)
        {
            String owner = MapValueConverter.getStringAttribute(Queue.OWNER, attributes, null);
View Full Code Here

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

                }
            }
        }
        if(!_attributes.containsKey(CREATED_BY))
        {
            final AuthenticatedPrincipal currentUser = SecurityManager.getCurrentUser();
            if(currentUser != null)
            {
                _attributes.put(CREATED_BY, currentUser.getName());
            }
        }
        if(!_attributes.containsKey(CREATED_TIME))
        {
            _attributes.put(CREATED_TIME, System.currentTimeMillis());
View Full Code Here

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

    }

    protected void attributeSet(String attributeName, Object oldAttributeValue, Object newAttributeValue)
    {

        final AuthenticatedPrincipal currentUser = SecurityManager.getCurrentUser();
        if(currentUser != null)
        {
            _attributes.put(LAST_UPDATED_BY, currentUser.getName());
            _lastUpdatedBy = currentUser.getName();
        }
        final long currentTime = System.currentTimeMillis();
        _attributes.put(LAST_UPDATED_TIME, currentTime);
        _lastUpdatedTime = currentTime;
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.