Package org.glassfish.security.common

Examples of org.glassfish.security.common.PrincipalImpl


            if (p != null) {
                subject.getPrincipals().add(p);
                logger.log(PROGRESS_LEVEL, "Attaching Principal {0}", p.getName());
                for (SecureAdminPrincipal sap : secureAdmin.getSecureAdminPrincipal()) {
                    if (sap.getDn().equals(p.getName())) {
                        subject.getPrincipals().add(new PrincipalImpl(AdminConstants.DOMAIN_ADMIN_GROUP_NAME));
                        break;
                    }
                }
            }
            return p != null;
View Full Code Here


                final PasswordCredential pwCred = new PasswordCredential(
                        nameCB.getName(),
                        pwCB.getPassword(),
                        authRealm);
                subject.getPrivateCredentials().add(pwCred);
                final Principal adminGroupPrincipal = new PrincipalImpl(AdminConstants.DOMAIN_ADMIN_GROUP_NAME);
                subject.getPrincipals().add(adminGroupPrincipal);
                logger.log(PROGRESS_LEVEL, "AdminLoginModule detected local password");
            }
            return result;
        }
View Full Code Here

      s = new Subject();
            if (_logger.isLoggable(Level.WARNING)) {
          _logger.warning("java_security.null_subject");
            }
  }
  this.initiator = new PrincipalImpl(userName);
        final Subject sub = s;
        this.subject = (Subject)
            AppservAccessController.doPrivileged(new PrivilegedAction(){
                public java.lang.Object run() {
                    sub.getPrincipals().add(initiator);
View Full Code Here

    } finally {
        if (guestUser == null) {
      guestUser = "ANONYMOUS";
        }
    }
    defaultSecurityContext.initiator = new PrincipalImpl(guestUser);
      }
  }
  return defaultSecurityContext.initiator;
    }
View Full Code Here

        if (principal == null) {
            if (cpCallback.getName() != null) {
                if (isCertRealm) {
                    principal = new X500Principal(cpCallback.getName());
                } else {
                    principal = new PrincipalImpl(cpCallback.getName());
                }
            } else {
                // 196 unauthenticated caller principal
                principal = SecurityContext.getDefaultCallerPrincipal();
            }
View Full Code Here

            // recover principles
            Enumeration<Principal> users = r.getUsersAssignedTo(new Role(role));
            Set<Principal> usersToRole = new HashSet<Principal>();
            for (; users.hasMoreElements();) {
                PrincipalImpl gp = (PrincipalImpl) users.nextElement();
                usersToRole.add(new PrincipalImpl(gp.getName()));
                addRoleToPrincipal(gp, role);
            }
            this.roleToPrincipal.put(role, usersToRole);
        }
    }
View Full Code Here

      s = new Subject();
            if (_logger.isLoggable(Level.WARNING)) {
          _logger.warning("java_security.null_subject");
            }
  }
  this.initiator = new PrincipalImpl(userName);
        final Subject sub = s;
        this.subject = (Subject)
            AppservAccessController.doPrivileged(new PrivilegedAction(){
                public java.lang.Object run() {
                    sub.getPrincipals().add(initiator);
View Full Code Here

    } finally {
        if (guestUser == null) {
      guestUser = "ANONYMOUS";
        }
    }
    defaultSecurityContext.initiator = new PrincipalImpl(guestUser);
      }
  }
  return defaultSecurityContext.initiator;
    }
View Full Code Here

        PrincipalGroupFactory factory = Globals.getDefaultHabitat().getService(PrincipalGroupFactory.class);
        if (factory != null)
            _userPrincipal =
                factory.getPrincipalInstance(getUsername(),realm_name);
        else
            _userPrincipal = new PrincipalImpl(getUsername());

        Set<Principal> principalSet = _subject.getPrincipals();
        if (!principalSet.contains(_userPrincipal)){
            principalSet.add(_userPrincipal);
        }
View Full Code Here

        PrincipalGroupFactory factory = Globals.getDefaultHabitat().getService(PrincipalGroupFactory.class);
        if (factory != null)
            _userPrincipal =
                factory.getPrincipalInstance(getUsername(),realm_name);
        else
            _userPrincipal = new PrincipalImpl(getUsername());

        Set<Principal> principalSet = _subject.getPrincipals();
        if (!principalSet.contains(_userPrincipal)){
            principalSet.add(_userPrincipal);
        }
View Full Code Here

TOP

Related Classes of org.glassfish.security.common.PrincipalImpl

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.