Examples of SimplePrincipal


Examples of org.jboss.security.SimplePrincipal

    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

Examples of org.jboss.security.SimplePrincipal

    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

Examples of org.jboss.security.SimplePrincipal

        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

Examples of org.jboss.security.SimplePrincipal

            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

Examples of org.jboss.security.SimplePrincipal

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

Examples of org.jboss.security.SimplePrincipal

        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

Examples of org.jboss.security.SimplePrincipal

     */
    private static void performTestingSecurityContext(final String user, final SecuredEJBRemote secured,
        final IntermediateEJBRemote intermediate) {
        try {
            if (user != null) {
                SecurityActions.securityContextSetPrincpal(new SimplePrincipal(user));
            }

            System.out.println("-------------------------------------------------");
            System.out
                .println(String.format("* * About to perform test as %s * *\n\n", user == null ? "ConnectionUser" : user));
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

     * @param args
     */
    public static void main(String[] args) throws Exception {
        System.out.println("\n\n\n* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");

        SimplePrincipal principal = new SimplePrincipal("quickstartUser");
        Object credential = new PasswordPlusCredential("quickstartPwd1!".toCharArray(), "7f5cc521-5061-4a5b-b814-bdc37f021acc");

        SecurityActions.securityContextSetPrincipalCredential(principal, credential);

        SecuredEJBRemote secured = lookupSecuredEJB();
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

                        connectionUser = (UserPrincipal) current;
                        break;
                    }
                }
            }
            userPrincipal = new SimplePrincipal(connectionUser.getName());
        } else {
            throw new IllegalStateException("Token authentication requested but no user on connection found.");
        }

        ContextStateCache stateCache = null;
View Full Code Here

Examples of org.jboss.security.SimplePrincipal

        if (credential instanceof OuterUserPlusCredential) {

            OuterUserPlusCredential oupc = (OuterUserPlusCredential) credential;

            if (verify(name, oupc.getName(), oupc.getAuthToken())) {
                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
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.