Examples of AppCallbackHandler


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

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

/*     */     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

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

      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

Examples of org.jboss.test.util.AppCallbackHandler

      // Specify the login conf file location
      String authConf = super.getResourceURL("security/auth.conf");
      getLog().debug("Using auth.conf: "+authConf);
      System.setProperty("java.security.auth.login.config", authConf);
      AppCallbackHandler handler = new AppCallbackHandler("admin", "admin".toCharArray());
      LoginContext lc = new LoginContext("testSecureHttpInvoker", handler);
      lc.login();

      // Test the secured JNDI factory
      env.setProperty(Context.PROVIDER_URL, INVOKER_BASE  + "restricted/JNDIFactory");
View Full Code Here

Examples of org.jboss.test.util.AppCallbackHandler

         // Set the config url to the security/auth.conf resource
         ClassLoader loader = Thread.currentThread().getContextClassLoader();
         URL authURL = loader.getResource("security/auth.conf");
         System.setProperty("java.security.auth.login.config", authURL.toString());
      }
      AppCallbackHandler handler = new AppCallbackHandler(username, password);
      log.debug("Creating LoginContext("+confName+")");
      LoginContext lc = new LoginContext(confName, handler);
      lc.login();
      log.debug("Created LoginContext, subject="+lc.getSubject());
      return lc;
View Full Code Here

Examples of org.jboss.test.util.AppCallbackHandler

   private void login() throws Exception
   {
      lc = null;
      String username = "jduke";
      char[] password = "theduke".toCharArray();
      AppCallbackHandler handler = new AppCallbackHandler(username, password);
      log.debug("Creating LoginContext(ejb-timers)");
      lc = new LoginContext("ejb-timers", handler);
      lc.login();
      log.debug("Created LoginContext, subject="+lc.getSubject());
   }
View Full Code Here

Examples of org.jboss.test.util.AppCallbackHandler

    */
   private void login(String username, char[] password) throws LoginException
   {
      // get the conf name from a system property - default is spec-test.
      String confName = System.getProperty("conf.name", "spec-test");
      AppCallbackHandler handler = new AppCallbackHandler(username, password);
      this.loginContext = new LoginContext(confName, handler);
      this.loginContext.login();
   }
View Full Code Here

Examples of org.jboss.test.util.AppCallbackHandler

     if( loggedIn )
        return;
    
     lc = null;
     String confName = System.getProperty("conf.name", "other");
     AppCallbackHandler handler = new AppCallbackHandler(username, password);
     log.debug("Creating LoginContext("+confName+")");
     lc = new LoginContext(confName, handler);
     lc.login();
     log.debug("Created LoginContext, subject="+lc.getSubject());
     loggedIn = true;
View Full Code Here

Examples of org.jboss.test.util.AppCallbackHandler

     if( loggedIn )
        return;
    
     lc = null;
     String confName = System.getProperty("conf.name", "jaas-test");
     AppCallbackHandler handler = new AppCallbackHandler(username, password);
     log.debug("Creating LoginContext("+confName+")");
     lc = new LoginContext(confName, handler);
     lc.login();
     log.debug("Created LoginContext, subject="+lc.getSubject());
     loggedIn = true;
View Full Code Here

Examples of org.jboss.test.util.AppCallbackHandler

      String pass = getPassword();
      String config = getLoginConfig();
      char[] password = null;
      if (pass != null)
         password = pass.toCharArray();
      AppCallbackHandler handler = new AppCallbackHandler(username, password);
      getLog().debug("Creating LoginContext(" + config + ")");
      lc = new LoginContext(config, handler);
      lc.login();
      getLog().debug("Created LoginContext, subject=" + lc.getSubject());
   }
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.