Package org.jboss.security

Examples of org.jboss.security.SimplePrincipal


         // Get the JBoss security manager from the ENC context
         SubjectSecurityManager securityMgr = getSubjectSecurityManager("authenticate( digest related)");
         if(securityMgr == null)
            return null;
        
         principal = new SimplePrincipal(username);
         Subject subject = new Subject();
         if (securityMgr.isValid(principal, digest, subject))
         {
            log.trace("User: " + username + " is authenticated");
            securityDomain = securityMgr.getSecurityDomain();
View Full Code Here


         // Get the JBoss security manager from the ENC context
         SubjectSecurityManager securityMgr = getSubjectSecurityManager("authenticate(username,cred)");
         if(securityMgr == null)
            return null;
        
         principal = new SimplePrincipal(username);
         Subject subject = new Subject();
         if (securityMgr.isValid(principal, credentials, subject))
         {
            log.trace("User: " + username + " is authenticated");
            securityDomain = securityMgr.getSecurityDomain();
View Full Code Here

   /**
    * Return the Principal associated with the given user name.
    */
   protected Principal getPrincipal(String username)
   {
      return new SimplePrincipal(username);
   }
View Full Code Here

      Set<Principal> userRoles = new HashSet<Principal>();
      if (roleNames != null)
      {
         for (int n = 0; n < roleNames.length; n++)
         {
            SimplePrincipal sp = new SimplePrincipal(roleNames[n]);
            userRoles.add(sp);
         }
      }
      return userRoles;
   }
View Full Code Here

    String roles = (String) options.get(ROLES_OPT + suffix);
    if (roles != null) {
      Group rolesGroup = new SimpleGroup(SecurityHelper.ROLES_GROUP_NAME);
      String[] rolesArray = roles.split(",");
      for (String role : rolesArray) {
        rolesGroup.addMember(new SimplePrincipal(role));
      }
      subject.getPrincipals().add(rolesGroup);
    }

    // in any case, clean out state
View Full Code Here

    Group subjectRoles = getRolesGroup(subject);
    if (subjectRoles != null) {
      boolean granted = false;
      if (!grantedRoles.isEmpty()) {
        for (String grantedRole : grantedRoles) {
          if (subjectRoles.isMember(new SimplePrincipal(grantedRole))) {
            granted = true;
            break;
          }
        }
      }
      if (!granted && !ungrantedRoles.isEmpty()) {
        granted = true;
        for (String ungrantedRole : ungrantedRoles) {
          if (subjectRoles.isMember(new SimplePrincipal(ungrantedRole))) {
            granted = false;
            break;
          }
        }
      }
View Full Code Here

        JBossUserPrincipal() {}
       
        JBossUserPrincipal(String name, Logger log)
        {
            _principal = new SimplePrincipal(name);
            this._logRef = log;

            if (log.isDebugEnabled())
                log.debug("created JBossUserRealm::JBossUserPrincipal: " + name);
        }
View Full Code Here

            boolean isUserInRole = false;
           
            if (!_roleStack.isEmpty() && _roleStack.peek().equals(role))
                return true;

            Set requiredRoles = Collections.singleton(new SimplePrincipal(role));
            if (_realm._realmMapping != null
               && _realm._realmMapping.doesUserHaveRole(this._principal,requiredRoles))
            {
                if (_logRef.isDebugEnabled())
                    _logRef.debug("JBossUserPrincipal: " + _principal + " is in Role: " + role);
View Full Code Here

         if( group == null )
         {
            group = new SimpleGroup(roleGroup);
            roleGroups.put(roleGroup, group);
         }
         SimplePrincipal role = new SimplePrincipal(roleName);
         group.addMember(role);
      }
View Full Code Here

        if (credential instanceof OuterUserCredential) {
            // This credential type will only be seen for a delegation request, if not seen then the request is not for us.

            if (delegationAcceptable(name, (OuterUserCredential) credential)) {

                identity = new SimplePrincipal(name);
                if (getUseFirstPass()) {
                    String userName = identity.getName();
                    if (log.isDebugEnabled())
                        log.debug("Storing username '" + userName + "' and empty password");
                    // Add the username and an empty password to the shared state map
View Full Code Here

TOP

Related Classes of org.jboss.security.SimplePrincipal

Copyright © 2018 www.massapicom. 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.