Examples of AppCallbackHandler


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

   {
      log.debug("+++ testLocalEJBMethodAccessWithJaasLogin");
      String confName = System.getProperty("conf.name", "spec-test");

      SecurityClient sc = SecurityClientFactory.getSecurityClient(JBossSecurityClient.class);
      AppCallbackHandler acbh = new AppCallbackHandler("scott","echoman".toCharArray());
      sc.setJAAS(confName, acbh);
      sc.login();
      InitialContext jndiContext = new InitialContext();
      Object obj = jndiContext.lookup("spec.CallerBean");
      obj = PortableRemoteObject.narrow(obj, CalledSessionHome.class);
View Full Code Here

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

      {
         String contextID = PolicyContext.getContextID();
         AuthConfigFactory factory = AuthConfigFactory.getFactory();
         AuthConfigProvider provider = factory.getConfigProvider(layer,contextID,null);
         ServerAuthConfig serverConfig = provider.getServerAuthConfig(layer,contextID,
                  new AppCallbackHandler("DUMMY","DUMMY".toCharArray()))
         ServerAuthContext sctx = serverConfig.getAuthContext(contextID,
               new Subject(), new HashMap());
         if(clientSubject == null)
            clientSubject = new Subject();
         Subject serviceSubject = new Subject();
View Full Code Here

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

      {
         String contextID = PolicyContext.getContextID();
         AuthConfigFactory factory = AuthConfigFactory.getFactory();
         AuthConfigProvider provider = factory.getConfigProvider(layer,contextID,null);
         ServerAuthConfig serverConfig = provider.getServerAuthConfig(layer,contextID,
                  new AppCallbackHandler("DUMMY","DUMMY".toCharArray()))
         ServerAuthContext sctx = serverConfig.getAuthContext(contextID,
               new Subject(), new HashMap());
         if(clientSubject == null)
            clientSubject = new Subject();
         Subject serviceSubject = new Subject();
View Full Code Here

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

     * @return CallbackHandler A callback handler that suitable for the login module configured.
     */
    protected CallbackHandler createCallbackHandler(final ConfigTree config)
    {
        final String username = configTree.getAttribute(SECURITY_PRINCIPAL);
        return new AppCallbackHandler(username, ((String)configTree.getAttribute(SECURITY_CREDENTIALS)).toCharArray());
    }
View Full Code Here

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

   {
      log.debug("+++ testLocalEJBMethodAccessWithJaasLogin");
      String confName = System.getProperty("conf.name", "spec-test");

      SecurityClient sc = SecurityClientFactory.getSecurityClient(JBossSecurityClient.class);
      AppCallbackHandler acbh = new AppCallbackHandler("scott","echoman".toCharArray());
      sc.setJAAS(confName, acbh);
      sc.login();
      InitialContext jndiContext = new InitialContext();
      Object obj = jndiContext.lookup("spec.CallerBean");
      obj = PortableRemoteObject.narrow(obj, CalledSessionHome.class);
View Full Code Here

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

      bacb = null;
   }
  
   public void testUserNamePassword() throws Exception
   {
      AppCallbackHandler apc = new AppCallbackHandler("jduke","theduke".toCharArray());
      //Create the Callbacks
      Callback[] cb = new Callback[]{ncb,pcb};
      apc.handle(cb);
      assertTrue("jduke", "jduke".equals(ncb.getName()));
      assertTrue("theduke","theduke".equals(new String(pcb.getPassword())) );
   }
View Full Code Here

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

   public void testMapCallback() throws Exception
   {
      HashMap hm = new HashMap();
      hm.put("jduke","theduke");
      hm.put("scott","echoman");
      AppCallbackHandler apc = new AppCallbackHandler(hm);
      Callback[] cb = new Callback[]{mcb};
      apc.handle(cb);
      assertTrue("jduke=theduke", "theduke".equals(mcb.getInfo("jduke")));
      assertTrue("scott=echoman", "echoman".equals(mcb.getInfo("scott")));
   }
View Full Code Here

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

      assertTrue("scott=echoman", "echoman".equals(mcb.getInfo("scott")));
   }
  
   public void testByteArrayCallback() throws Exception
   {
      AppCallbackHandler apc = new AppCallbackHandler("scott",
                      "echoman".toCharArray(), "Loves Skiing!!!".getBytes());
      //Create the Callbacks
      Callback[] cb = new Callback[]{ncb,pcb,bacb};
      apc.handle(cb);
      assertTrue("scott", "scott".equals(ncb.getName()));
      assertTrue("echoman","echoman".equals(new String(pcb.getPassword())) );
      assertTrue("Loves Skiing!!!",
            "Loves Skiing!!!".equals(new String(bacb.getByteArray())));
   }
View Full Code Here

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

    multiple sessions for the same user. This creates two threads
    */
   public void testSRPLoginWithMultipleSessions() throws Exception
   {
      log.debug("+++ testSRPLoginWithMultipleSessions");
      AppCallbackHandler handler = new AppCallbackHandler(username, password, null);
      MBeanServerConnection server = super.getServer();

      // Session #1
      SessionThread t1 = new SessionThread(log, handler, server);
      t1.start();
View Full Code Here

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

   {
      if( loggedIn )
         return;

      lc = null;
      AppCallbackHandler handler = new AppCallbackHandler(username, password, data, text);
      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
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.