Examples of UsernamePrincipal


Examples of org.apache.jetspeed.om.security.UserNamePrincipal

     * @see UserManagement#getUser
     */
    public static JetspeedUser getUser(String username)
        throws JetspeedSecurityException
    {
        return JetspeedUserManagement.getUser(new UserNamePrincipal(username));
    }
View Full Code Here

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

                if (_logger.isDebugEnabled())
                {
                    _logger.debug("Authenticated as " + authorizationID);
                }

                return new AuthenticationResult(new UsernamePrincipal(authorizationID));
            }
            else
            {
                return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.CONTINUE);
            }
View Full Code Here

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

        {
            AuthenticationResult result = doLDAPNameAuthentication(getNameFromId(username), password);
            if(result.getStatus() == AuthenticationStatus.SUCCESS)
            {
                //Return a result based on the supplied username rather than the search name
                return new AuthenticationResult(new UsernamePrincipal(username));
            }
            else
            {
                return result;
            }
View Full Code Here

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

        try
        {
            ctx = createInitialDirContext(env);

            //Authentication succeeded
            return new AuthenticationResult(new UsernamePrincipal(name));
        }
        catch(AuthenticationException ae)
        {
            //Authentication failed
            return new AuthenticationResult(AuthenticationStatus.CONTINUE);
View Full Code Here

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

            }
            if(LOGGER.isDebugEnabled())
            {
                LOGGER.debug("Constructing Principal with username: " + username);
            }
            return new UsernamePrincipal(username);
        }
        else
        {
            if(LOGGER.isDebugEnabled())
            {
View Full Code Here

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

        setVirtualHost(virtualHost);
    }

    private void setTestAuthorizedSubject()
    {
        Principal principal = new AuthenticatedPrincipal(new UsernamePrincipal("InternalTestProtocolSession"));
        Subject authorizedSubject = new Subject(
                true,
                Collections.singleton(principal),
                Collections.emptySet(),
                Collections.emptySet());
View Full Code Here

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

    }

    public void testAuthenticatePrincipalCnOnly() throws Exception
    {
        X500Principal principal = new X500Principal("CN=person");
        UsernamePrincipal expectedPrincipal = new UsernamePrincipal("person");
        SaslServer saslServer = _manager.createSaslServer("EXTERNAL", "example.example.com", principal);

        AuthenticationResult result = _manager.authenticate(saslServer, new byte[0]);
        assertNotNull(result);
        assertEquals("Expected authentication to be successful",
View Full Code Here

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

    }

    public void testAuthenticatePrinicpalCnAndDc() throws Exception
    {
        X500Principal principal = new X500Principal("CN=person, DC=example, DC=com");
        UsernamePrincipal expectedPrincipal = new UsernamePrincipal("person@example.com");
        SaslServer saslServer = _manager.createSaslServer("EXTERNAL", "example.example.com", principal);

        AuthenticationResult result = _manager.authenticate(saslServer, new byte[0]);
        assertNotNull(result);
        assertEquals("Expected authentication to be successful",
View Full Code Here

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

    }

    public void testAuthenticatePrinicpalCnDc_OtherComponentsIgnored() throws Exception
    {
        X500Principal principal = new X500Principal("CN=person, DC=example, DC=com, O=My Company Ltd, L=Newbury, ST=Berkshire, C=GB");
        UsernamePrincipal expectedPrincipal = new UsernamePrincipal("person@example.com");
        SaslServer saslServer = _manager.createSaslServer("EXTERNAL", "example.example.com", principal);

        AuthenticationResult result = _manager.authenticate(saslServer, new byte[0]);
        assertNotNull(result);
        assertEquals("Expected authentication to be successful",
View Full Code Here

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

    }

    public void testAuthenticatePrincipalCn_OtherComponentsIgnored() throws Exception
    {
        X500Principal principal = new X500Principal("CN=person, O=My Company Ltd, L=Newbury, ST=Berkshire, C=GB");
        UsernamePrincipal expectedPrincipal = new UsernamePrincipal("person");
        SaslServer saslServer = _manager.createSaslServer("EXTERNAL", "example.example.com", principal);

        AuthenticationResult result = _manager.authenticate(saslServer, new byte[0]);
        assertNotNull(result);
        assertEquals("Expected authentication to be successful",
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.