Package org.jboss.security.auth.callback

Examples of org.jboss.security.auth.callback.AppCallbackHandler


      //Ignore
   }  
  
   public void testLDAPDecodeAction() throws Exception
   {
      LoginContext lc = new LoginContext("test", new AppCallbackHandler("jduke","theduke".toCharArray()));
      lc.login();
   }
View Full Code Here


/*     */     try
/*     */     {
/* 380 */       String contextID = PolicyContext.getContextID();
/* 381 */       AuthConfigFactory factory = AuthConfigFactory.getFactory();
/* 382 */       AuthConfigProvider provider = factory.getConfigProvider(layer, contextID, null);
/* 383 */       ServerAuthConfig serverConfig = provider.getServerAuthConfig(layer, contextID, new AppCallbackHandler("DUMMY", "DUMMY".toCharArray()));
/*     */
/* 385 */       ServerAuthContext sctx = serverConfig.getAuthContext(contextID, new Subject(), new HashMap());
/*     */
/* 387 */       if (clientSubject == null)
/* 388 */         clientSubject = new Subject();
View Full Code Here

      xli.loadConfig();
   }
  
   public void testIsValid()
   {
      CallbackHandler cbh = new AppCallbackHandler("anil",
            "anilpwd".toCharArray());
      MessageInfo messageInfo = new GenericMessageInfo(new Object(), new Object());
      JASPIServerAuthenticationManager jaspiManager = new JASPIServerAuthenticationManager();
      boolean valid = jaspiManager.isValid(messageInfo, new Subject(), layer,
                                       cbh);
View Full Code Here

      assertTrue(valid);
   }
  
   public void testIsInValid()
   {
      CallbackHandler cbh = new AppCallbackHandler("anil",
            "dead".toCharArray());
      MessageInfo messageInfo = new GenericMessageInfo(new Object(), new Object());
      JASPIServerAuthenticationManager jaspiManager = new JASPIServerAuthenticationManager();
      boolean valid = jaspiManager.isValid(messageInfo, new Subject(), layer,
                                       cbh);
View Full Code Here

      AuthConfigProvider provider = factory.getConfigProvider("TEST", "APP", null);
      assertNotNull("AuthConfigProvider is ! null", provider);
     
      ServerAuthConfig serverConfig =
         provider.getServerAuthConfig("TEST", "APP",
               new AppCallbackHandler("anil","anil".toCharArray()));
      assertNotNull("ServerAuthConfig ! null", serverConfig);
      MessageInfo mi = new GenericMessageInfo(new Object(), new Object());
      String authContextID = serverConfig.getAuthContextID(mi);
      assertNotNull("AuthContext ID != null",authContextID);
      ServerAuthContext sctx = serverConfig.getAuthContext(authContextID,
View Full Code Here

      AuthConfigProvider provider = factory.getConfigProvider("TEST", "APP", null);
      assertNotNull("AuthConfigProvider is ! null", provider);
     
      ClientAuthConfig clientConfig =
         provider.getClientAuthConfig("TEST", "APP",
               new AppCallbackHandler("anil","anil".toCharArray()));
      assertNotNull("ClientAuthConfig ! null", clientConfig);
      MessageInfo mi = new GenericMessageInfo(new Object(), new Object());
      String authContextID = clientConfig.getAuthContextID(mi);
      assertNotNull("AuthContext ID != null",authContextID);
      ClientAuthContext sctx = clientConfig.getAuthContext(authContextID,
View Full Code Here

      ejbResource.setEjbMethod(DummyClass.class.getMethod("someMethod", new Class[0]));
      ejbResource.setEjbMethodInterface("void someMethod");
      ejbResource.setEjbMethodRoles(SecurityTestUtil.getRoleGroup(new String[]{"roleA", "roleC"}));     
     
      AuthorizationContext ac = new JBossAuthorizationContext("test",
            new AppCallbackHandler("a","b".toCharArray()));
      int result = ac.authorize(ejbResource, new Subject(), principalRole);
      assertEquals(AuthorizationContext.PERMIT, result)
   }
View Full Code Here

      ejbResource.setEjbMethod(DummyClass.class.getMethod("someMethod", new Class[0]));
      ejbResource.setEjbMethodInterface("void someMethod");
      ejbResource.setEjbMethodRoles(SecurityTestUtil.getRoleGroup(new String[]{"roleA", "roleC"}));
     
      AuthorizationContext ac = new JBossAuthorizationContext("test",
             new AppCallbackHandler("a","b".toCharArray()));
      try
      {
         ac.authorize(ejbResource, new Subject(), principalRole);
         fail("Should have failed");
      }
View Full Code Here

     
      cmap.put(ResourceKeys.ROLEREF_PERM_CHECK, Boolean.TRUE);
      cmap.put(ResourceKeys.ROLENAME, "roleLink");
     
      AuthorizationContext ac = new JBossAuthorizationContext("test",
            new AppCallbackHandler("a","b".toCharArray()));
      int result = ac.authorize(ejbResource, new Subject(), principalRole);
      assertEquals(AuthorizationContext.PERMIT, result);
   }
View Full Code Here

   }

   public void testSecurityDomain() throws Exception
   {
      AuthenticationManager am = new JBossAuthenticationManager("test1",
            new AppCallbackHandler("a","b".toCharArray()));
      assertEquals("test1", am.getSecurityDomain());
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.auth.callback.AppCallbackHandler

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.