Examples of Principal


Examples of java.security.Principal

      return isValid;
   }

   public Principal getPrincipal(String securityDomain, Principal principal)
   {
      Principal realmPrincipal = null;
      try
      {
         SecurityDomainContext sdc = lookupSecurityDomain(securityDomain);
         realmPrincipal = sdc.getRealmMapping().getPrincipal(principal);
      }
View Full Code Here

Examples of java.security.Principal

   {

      /* this gets called by the interceptor */

      Transaction tx = mi.getTransaction();
      Principal princ = mi.getPrincipal();
      Method method = mi.getMethod();
      Entry start = new Entry(princ, method, tx, begin, "START");
      Entry stop = new Entry(princ, method, tx, end, "STOP");

      // add both entries, order is guaranteed, synchronized to prevent
View Full Code Here

Examples of java.security.Principal

    *
    * @param principal The new Principal, or <code>null</code> if none
    */
   public void setPrincipal(Principal principal)
   {
      Principal oldPrincipal = this.principal;
      this.principal = principal;
      support.firePropertyChange("principal", oldPrincipal, this.principal);

      if ((oldPrincipal != null && !oldPrincipal.equals(principal)) ||
         (oldPrincipal == null && principal != null))
         sessionMetadataDirty();
   }
View Full Code Here

Examples of java.security.Principal

         if (opName.equals("invoke"))
         {
            Object[] args = invocation.getArgs();
            org.jboss.invocation.Invocation inv = (org.jboss.invocation.Invocation) args[0];
            // Authenticate the caller based on the security association
            Principal caller = inv.getPrincipal();
            //Get the Method Name
            Object[] obj = inv.getArguments();
            //Ignore calls like MBeanCount or getMBeanInfo
            if(obj != null && obj.length > 1)
            {
View Full Code Here

Examples of java.security.Principal

   {
      if(this.securityManagement == null)
         throw new IllegalStateException("SecurityManagement has not been injected");
      Subject subject = new Subject();
      //Validate the caller
      Principal principal = SecurityActions.getPrincipal();
      AuthenticationManager authenticationManager = securityManagement.getAuthenticationManager(securityDomainName);
      if(authenticationManager == null)
      {
         String defaultSecurityDomain = SecurityConstants.DEFAULT_APPLICATION_POLICY;
         if(log.isTraceEnabled())
View Full Code Here

Examples of java.security.Principal

      // get a reference to the remote protected stateless session bean.
      Object obj = getInitialContext().lookup("SimpleStatelessSessionBean/remote");
      SimpleSession session = (SimpleSession) PortableRemoteObject.narrow(obj, SimpleSession.class);

      Principal principal = null;
      try
      {
         principal = session.invokeRegularMethod();
         if (!(principal instanceof EJB3CustomPrincipalImpl))
            fail("Custom principal is not the caller principal");
View Full Code Here

Examples of java.security.Principal

      subject = lc.getSubject();
      Iterator iter = subject.getPrincipals().iterator();
      boolean ranAsserts = false;
      while(iter.hasNext())
      {
         Principal p = (Principal)iter.next();
         if(p instanceof SimpleGroup)
         {
            SimpleGroup sg = (SimpleGroup)p;
            ranAsserts = true;
            assertTrue("testRole exists?", sg.isMember(new SimplePrincipal("testRole")));
View Full Code Here

Examples of java.security.Principal

         Subject subject = getSubjectAndSecurityDomain();
         if(trace)
            log.trace("securityDomain="+ securityDomain);
         if(securityDomain == null)
            log.debug("Unable to obtain SecurityDomain");
         Principal principal = getPrincipal(subject);
         if(principal == null)
         {
            if(trace)
               log.trace("Searching for principal in the session");
            principal = (Principal) httpSessionEvent.getSession().getAttribute(JBOSS_PRINCIPAL);
View Full Code Here

Examples of java.security.Principal

    * @param subject
    * @return the authenticated principal
    */
   private Principal getPrincipal(Subject subject)
   {
      Principal principal = null;
      if(subject != null)
      {
         Set principals = subject.getPrincipals();
         if(principals != null || !principals.isEmpty())
         {
View Full Code Here

Examples of java.security.Principal

   /**
    * @return the name of the Principal
    */
   public String getAsText()
   {
      Principal principal = (Principal) getValue();
      return principal.getName();
   }
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.