Examples of TgtRequest


Examples of org.apache.directory.kerberos.client.TgtRequest

   
   
    @Test
    public void testKrbErrPreAuthRequired() throws Exception
    {
        TgtRequest tgtReq = new TgtRequest();
        tgtReq.setClientPrincipal( principalName );
        tgtReq.setPassword( userPassword );

        try
        {
            conn._getTgt( tgtReq );
        }
View Full Code Here

Examples of org.apache.directory.kerberos.client.TgtRequest

   
    @Test
    public void testKrbErrCantPostdate() throws Exception
    {
        TgtRequest tgtReq = new TgtRequest();
        tgtReq.setClientPrincipal( principalName );
        tgtReq.setPassword( userPassword );
        tgtReq.setStartTime( System.currentTimeMillis() + 600000 ); // now + 10 min
       
        try
        {
            conn.getTgt( tgtReq );
            fail("should fail with KDC_ERR_CANNOT_POSTDATE");
        }
        catch( KerberosException e )
        {
            KrbError err = e.getError();
            assertNotNull( err );
            assertEquals( ErrorType.KDC_ERR_CANNOT_POSTDATE, err.getErrorCode() );
        }
       
        tgtReq.setPostdated( true );
        TgTicket tgt = conn.getTgt( tgtReq );
        assertNotNull( tgt );
    }
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.