Examples of Identity


Examples of org.exoplatform.services.security.Identity

      if (conv == null)
      {
         return guest;
      }

      Identity id = conv.getIdentity();
      if (id == null)
      {
         return guest;
      }
View Full Code Here

Examples of org.exoplatform.services.security.Identity

      {
         if (id != null)
         {
            Collection<String> roles = Collections.emptySet();
            Set<MembershipEntry> memberships = new HashSet<MembershipEntry>();
            identity = new Identity(id, memberships, roles);
         }
         else
         {
            identity = null;
         }
View Full Code Here

Examples of org.jabber.protocol.disco_info.Identity

        answer.setNode(node);
        return answer;
    }

    protected Identity createIdentity(String category, String type, String name) {
        Identity answer = new Identity();
        answer.setCategory(category);
        answer.setName(name);
        answer.setType(type);
        return answer;
    }
View Full Code Here

Examples of org.jboss.as.domain.management.plugin.Identity

                    if (current instanceof AuthorizeCallback) {
                        toRespondTo.add(current);
                    } else if (current instanceof NameCallback) {
                        NameCallback nameCallback = (NameCallback) current;
                        userName = nameCallback.getDefaultName();
                        Identity identity = ap.loadIdentity(userName, realmName);
                        if (identity != null) {
                            credential = identity.getCredential();
                        }
                    } else if (current instanceof PasswordCallback) {
                        toRespondTo.add(current);
                    } else if (current instanceof DigestHashCallback) {
                        toRespondTo.add(current);
View Full Code Here

Examples of org.jboss.identity.idm.api.Identity

      {
         Group parent = parentsIterator.next();

         for (Iterator<Identity> membersIterator = members.iterator(); membersIterator.hasNext();)
         {
            Identity member = membersIterator.next();

            associateIdentities(parent, member);
         }
      }
   }
View Full Code Here

Examples of org.jboss.remoting.ident.Identity

   protected boolean isRemoteDetection(Detection detection)
   {
      String domain = null;
      if(detection != null)
      {
         Identity identity = detection.getIdentity();
         if(identity != null)
         {
            domain = identity.getDomain();
         }
      }
      // is detection domain in accepted domain collection and not local
      // if domains empty, then accept all
      return (domain == null || domains.isEmpty() || domains.contains(domain)) &&
View Full Code Here

Examples of org.jboss.seam.security.Identity

      assert request.isUserInRole(JAAS_ROLE);
   }
  
   public HttpServletRequest initializeWrappedRequest() {
      HttpSession session = new MockHttpSession();
      Identity identity = new Identity() {

         @Override
         public Principal getPrincipal()
         {
            return new SimplePrincipal(SEAM_USER);
View Full Code Here

Examples of org.jboss.seam.security.Identity

         Lifecycle.beginCall();
        
         // Create a mock session
         Contexts.getSessionContext().set(Component.getComponentName(Session.class), new Session());
        
         Identity identity = new MockIdentity();
         identity.create();
        
         // Put the identity into our session context
         Contexts.getSessionContext().set(Component.getComponentName(Identity.class), identity);        
        
         // Test addRole()
         identity.addRole("admin");
        
         assert(!identity.hasRole("admin"));
        
         try
         {
            // This should throw a NotLoggedInException
            identity.checkRole("admin");
            assert(false);
         }
         catch (NotLoggedInException ex)
         {
            // expected
         }        
                 
         identity.getCredentials().setUsername("foo");
         identity.getCredentials().setPassword("bar");
        
         assert("foo".equals(identity.getCredentials().getUsername()));
         assert("bar".equals(identity.getCredentials().getPassword()));
        
         assert("loggedIn".equals(identity.login()));
         assert(identity.isLoggedIn());
        
         // Pre-authenticated roles are cleared before authenticating,
         // so this should still return false
         assert(!identity.hasRole("admin"));
        
         // The foo role is added by MockLoginModule
         assert(identity.hasRole("foo"));
        
         identity.removeRole("foo");
         assert(!identity.hasRole("foo"));
        
         try
         {
            // This should throw an AuthorizationException
            identity.checkRole("foo");
            assert(false);
         }
         catch (AuthorizationException ex)
         {
            // expected
         }
        
         // Now that we're authenticated, adding a role should have an immediate effect
         identity.addRole("admin");
         assert(identity.hasRole("admin"));
                 
         identity.logout();
        
         assert(!identity.hasRole("admin"));        
         assert(!identity.isLoggedIn());
      }
      finally
      {
         Lifecycle.endApplication();
      }
View Full Code Here

Examples of org.jboss.seam.security.Identity

   @Test
   public void testDisableSecurity()
   {
      try
      {     
         Identity identity = new Identity();
         identity.create();
        
         // Disable security
         Identity.setSecurityEnabled(false);
        
         assert(!Identity.isSecurityEnabled());
         assert(identity.hasRole("admin"));
         assert(identity.hasPermission("foo", "bar"));
  
         // This shouldn't throw an exception while security is disabled
         identity.checkRestriction("foo");
        
         // Enable security
         Identity.setSecurityEnabled(true);
         assert(Identity.isSecurityEnabled());
         assert(!identity.hasRole("admin"));
         assert(!identity.hasPermission("foo", "bar"));
      }
      finally
      {
         Identity.setSecurityEnabled(true);
      }     
View Full Code Here

Examples of org.jboss.security.identity.Identity

        Principal principal = util.getUserPrincipal();
        Object credential = util.getCredential();

        boolean authenticated = false;
        if (principal == null) {
            Identity unauthenticatedIdentity = getUnauthenticatedIdentity();
            subjectInfo.addIdentity(unauthenticatedIdentity);
            subject.getPrincipals().add(unauthenticatedIdentity.asPrincipal());
            authenticated = true;
        }

        if (authenticated == false) {
            AuthenticationManager authenticationManager = context.getAuthenticationManager();
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.