Examples of SimplePrincipal


Examples of org.jboss.security.SimplePrincipal

      {
         roles =  new SimpleGroup("Roles");
         subject.getPrincipals().add(roles);
      }

      roles.addMember(new SimplePrincipal(role));

   }
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
        props.put(Context.PROVIDER_URL, url);
        props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");

        if(username != null){
            SecurityAssociation.setPrincipal(new SimplePrincipal(username));
            SecurityAssociation.setCredential(password);
        }

        // As of 3.2.2 version of JBoss "jmx/invoker/RMIAdaptor" is the new JNDI entry for RMIAdaptor.
        ///  But there is a naming alias setup from jmx/rmi/RMIAdaptor to jmx/invoker/RMIAdaptor,
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

      }

      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
      Queue queue = (Queue)ic.lookup("/queue/TestQueue");

      Principal nabopolassar = new SimplePrincipal("nabopolassar");
      Set principals = new HashSet();
      principals.add(nabopolassar);
      Subject subject =
         new Subject(false, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
      Principal nebuchadrezzar = new SimplePrincipal("nebuchadrezzar");

      SecurityAssociation.pushSubjectContext(subject, nebuchadrezzar, "xexe");

      Connection conn = null;
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

      assertTrue(sm.isSimulateJBossJaasSecurityManager());

      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
      Queue queue = (Queue)ic.lookup("/queue/SecureTestQueue");

      Principal nabopolassar = new SimplePrincipal("nabopolassar");
      Set principals = new HashSet();
      principals.add(nabopolassar);
      Subject subject =
         new Subject(false, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
      Principal nebuchadrezzar = new SimplePrincipal("nebuchadrezzar");

      SecurityAssociation.pushSubjectContext(subject, nebuchadrezzar, "xexe");

      Connection conn = null;
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

      assertTrue(sm.isSimulateJBossJaasSecurityManager());

      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
      Queue queue = (Queue)ic.lookup("/queue/SecureTestQueue");

      Principal nabopolassar = new SimplePrincipal("nabopolassar");
      Set principals = new HashSet();
      principals.add(nabopolassar);
      Subject subject =
         new Subject(false, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
      Principal nebuchadrezzar = new SimplePrincipal("nebuchadrezzar");

      SecurityAssociation.pushSubjectContext(subject, nebuchadrezzar, "xexe");

      Connection conn = null;
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

                MBeanServerConnection server = (MBeanServerConnection)context.lookup("jmx/invoker/RMIAdaptor");
                ObjectName objectName = new ObjectName("jboss.jca:name="+_dataSourceId+",service=ManagedConnectionFactory");

                if(_username !=null && _password !=null)
                {
                  SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
                  SecurityAssociation.setCredential(_password);
                }

                String className = (String)server.invoke(objectName, "getManagedConnectionFactoryAttribute", new Object[] {"XADataSourceClass"}, new String[] {"java.lang.String"});
            if (log.isDebugEnabled())
        {
                  log.debug("AppServerJDBCXARecovery datasource classname = "+className);
                }

                if(_username !=null && _password !=null)
                {
                  SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
                  SecurityAssociation.setCredential(_password);
                }

                String properties = (String)server.invoke(objectName, "getManagedConnectionFactoryAttribute", new Object[] {"XADataSourceProperties"}, new String[] {"java.lang.String"});
                // debug disabled due to security paranoia - it may log datasource password in cleartext.
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

            {
               // User name and password use-case
               Subject subject = new Subject();

               // Principals
               Principal p = new SimplePrincipal(recoverUserName);
               subject.getPrincipals().add(p);

               // PrivateCredentials
               PasswordCredential pc = new PasswordCredential(recoverUserName, recoverPassword.toCharArray());
               pc.setManagedConnectionFactory(mcf);
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

      }
      else
      {
         // Simply convert this to a name using toString
         String username = principal.toString();
         securityPrincipal = new SimplePrincipal(username);
      }
      SecurityContext sc = SecurityAssociationActions.createSecurityContext(securityPrincipal, credentials, null);
      SecurityAssociationActions.setSecurityContext(sc);
      // Now return the context using the standard jnp naming context factory
      Context iniCtx = super.getInitialContext(env);
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

         fail("Security exception expected");
      }
      catch (Exception e)
      {
         // all cool, now try again with valid credentials
         SecurityAssociation.setPrincipal(new SimplePrincipal(USERNAME));
         SecurityAssociation.setCredential(PASSWORD);
         bean = home.create();
      }

      String info = bean.getContactInfo("mafia");
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

         sig, iface);
      //Convert this into Set of Principals
      Set<Principal> principalSet = new HashSet<Principal>();
      for(String perm: permissions)
      {
         principalSet.add(new SimplePrincipal(perm));
      }
      return principalSet;
   }
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.