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

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


            }

            public AuthenticationResult authenticate(String username, String password)
            {
                if (exception != null) {
                    return new AuthenticationResult(AuthenticationStatus.ERROR, exception);
                }
                else if (successfulAuth)
                {
                    return new AuthenticationResult(new Subject());
                }
                else
                {
                    return new AuthenticationResult(AuthenticationStatus.CONTINUE);
                }
            }
        };
    }
View Full Code Here


     */
    public void testSaslAuthenticationSuccess() throws Exception
    {
        SaslServer testServer = createTestSaslServer(true, false);
       
        AuthenticationResult result = _manager.authenticate(testServer, "12345".getBytes());
        final Subject subject = result.getSubject();
        assertTrue(subject.getPrincipals().contains(new UsernamePrincipal("guest")));
        assertEquals(AuthenticationStatus.SUCCESS, result.getStatus());
    }
View Full Code Here

     */
    public void testSaslAuthenticationNotCompleted() throws Exception
    {
        SaslServer testServer = createTestSaslServer(false, false);
       
        AuthenticationResult result = _manager.authenticate(testServer, "12345".getBytes());
        assertNull(result.getSubject());
        assertEquals(AuthenticationStatus.CONTINUE, result.getStatus());
    }
View Full Code Here

     */
    public void testSaslAuthenticationError() throws Exception
    {
        SaslServer testServer = createTestSaslServer(false, true);
       
        AuthenticationResult result = _manager.authenticate(testServer, "12345".getBytes());
        assertNull(result.getSubject());
        assertEquals(AuthenticationStatus.ERROR, result.getStatus());
    }
View Full Code Here

     * authentication success.
     *
     */
    public void testNonSaslAuthenticationSuccess() throws Exception
    {
        AuthenticationResult result = _manager.authenticate("guest", "guest");
        final Subject subject = result.getSubject();
        assertFalse("Subject should not be set read-only", subject.isReadOnly());
        assertTrue(subject.getPrincipals().contains(new UsernamePrincipal("guest")));
        assertEquals(AuthenticationStatus.SUCCESS, result.getStatus());
    }
View Full Code Here

     * authentication success.
     *
     */
    public void testNonSaslAuthenticationNotCompleted() throws Exception
    {
        AuthenticationResult result = _manager.authenticate("guest", "wrongpassword");
        assertNull(result.getSubject());
        assertEquals(AuthenticationStatus.CONTINUE, result.getStatus());
    }
View Full Code Here

            // Process response from the client
            byte[] challenge = server.evaluateResponse(response != null ? response : new byte[0]);

            if (server.isComplete())
            {
                return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.SUCCESS);
            }
            else
            {
                return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.CONTINUE);
            }
        }
        catch (SaslException e)
        {
            return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, e);
        }
    }
View Full Code Here

            // Process response from the client
            byte[] challenge = server.evaluateResponse(response != null ? response : new byte[0]);

            if (server.isComplete())
            {
                return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.SUCCESS);
            }
            else
            {
                return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.CONTINUE);
            }
        }
        catch (SaslException e)
        {
            return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR);
        }
    }
View Full Code Here

        }
    }

    public AuthenticationResult isAuthorize(VirtualHost vhost, String username)
    {
        return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR);
    }
View Full Code Here

                );
            }

            session.setSaslServer(ss);

            AuthenticationResult authResult = authMgr.authenticate(ss, body.response);

            //save clientProperties
            if (session.getClientProperties() == null)
            {
                session.setClientProperties(body.clientProperties);
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.security.auth.AuthenticationResult

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.