Package org.jboss.security

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


     * @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

                        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

        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

         if (domain != null)
         {
            String unauth = domain.unauthenticatedPrincipal();
            if (unauth != null && unauth.length() > 0)
            {
               callerPrincipal = new SimplePrincipal(unauth);
            }
         }
      }
      return callerPrincipal;
   }
View Full Code Here

  
   public Subject authenticate(String user, String password) throws JMSSecurityException
   {
      if (trace) { log.trace("authenticating user " + user); }
     
      SimplePrincipal principal = new SimplePrincipal(user);
      char[] passwordChars = null;
      if (password != null)
      {
         passwordChars = password.toCharArray();
      }
View Full Code Here

        //The special user SUCKER_USER is used for creating internal connections that suck messages between nodes
        //It has automatic read/write access to all destinations
        return (checkType.equals(CheckType.READ) || checkType.equals(CheckType.WRITE));
      }

      Principal principal = user == null ? null : new SimplePrincipal(user);
 
      boolean hasRole = realmMapping.doesUserHaveRole(principal, rolePrincipals);

      if (trace) { log.trace("user " + user + (hasRole ? " is " : " is NOT ") + "authorized"); }
View Full Code Here

                    subject = sinfo.getSubject();

                    Set<PasswordCredential> pcSet = subject.getPrivateCredentials(PasswordCredential.class);
                    if (pcSet.size() > 0) {
                        PasswordCredential pc = pcSet.iterator().next();
                        p = new SimplePrincipal(pc.getUserName());
                        credential = new String(pc.getCredential());
                        RemotingContext.clear(); // Now that it has been used clear it.
                    }
                }
                if (p == null || credential == null) {
                    p = new SimplePrincipal(UUID.randomUUID().toString());
                    credential = UUID.randomUUID().toString();
                }

                util.createSubjectInfo(p, credential, subject);
            }
View Full Code Here

   {
      String mapping = principals.get(name);

      if (mapping != null)
      {
         return new SimplePrincipal(mapping);
      }

      return null;
   }
View Full Code Here

                     domain = value;
                  }
                  else if ("default-principal".equals(key))
                  {
                     if (value != null && !value.trim().equals(""))
                        defaultPrincipal = new SimplePrincipal(value);
                  }
                  else if ("default-groups".equals(key))
                  {
                     if (value != null && !value.trim().equals(""))
                     {
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.