Examples of Principal


Examples of java.security.Principal

         getLog().debug(" + "+entry);
      }
      ctx.close();
      lc.logout();

      Principal p = SecurityAssociation.getPrincipal();
      assertTrue("SecurityAssociation.getPrincipal is null", p == null);

      /* This is now failing because we don't appear to have anyway to flush
      the java.net.Authenticator cache. Need to figure out how this can
      be done or switch a better http client library.
View Full Code Here

Examples of java.security.Principal

      }

      String user, pass;
      user = pair[0];
      pass = pair[1];
      Principal principal = new JMXPrincipal(user);
      Subject subject = new Subject();

      securityContext = SecurityFactory.establishSecurityContext(securityDomainName);
      am = securityContext.getAuthenticationManager();
View Full Code Here

Examples of java.security.Principal

            {
               // User name and password use-case
               Subject subject = new Subject();

               // Principals
               Principal p = new SimplePrincipal(recoverUserName);
               subject.getPrincipals().add(p);

               // PrivateCredentials
               PasswordCredential pc = new PasswordCredential(recoverUserName, recoverPassword.toCharArray());
               pc.setManagedConnectionFactory(mcf);
View Full Code Here

Examples of java.security.Principal

   2. Validate access to the method by checking the principal's roles against
   those required to access the method.
   */
   private void checkSecurityContext(Invocation mi, RunAs callerRunAsIdentity) throws Exception
   {
      Principal principal = mi.getPrincipal();
      Object credential = mi.getCredential();

      boolean trace = log.isTraceEnabled();

      // If there is not a security manager then there is no authentication required
View Full Code Here

Examples of java.security.Principal

      if (LOG.isTraceEnabled())
          LOG.trace(" Checking for cached principal for " + ssoId);
      JBossSingleSignOnEntry entry = getSingleSignOnEntry(cookie.getValue());
      if (entry != null && isValid(ssoId, entry))
      {
         Principal ssoPrinc = entry.getPrincipal();
         // have to deal with the fact that the entry may not have an
         // associated Principal. SSO entries retrieved via a lookup from a
         // cluster will not have a Principal, as Principal is not Serializable
         if (LOG.isTraceEnabled())
         {
             LOG.trace(" Found cached principal '" +
               (ssoPrinc == null ? "NULL" : ssoPrinc.getName()) +
               "' with auth type '" + entry.getAuthType() + "'");
         }
         request.setNote(Constants.REQ_SSOID_NOTE, cookie.getValue());
         // Only set security elements if per-request reauthentication is
         // not required AND the SSO entry had a Principal. 
View Full Code Here

Examples of java.security.Principal

      {

         String username = entry.getUsername();
         if (username != null)
         {
            Principal reauthPrincipal =
               realm.authenticate(username, entry.getPassword());
            if (reauthPrincipal != null)
            {
               reauthenticated = true;                   
               // Bind the authorization credentials to the request
View Full Code Here

Examples of java.security.Principal

                   " to auth type " + credentials.getAuthType());

         synchronized (sso)
         {
            // Use the existing principal
            Principal p = sso.getPrincipal();
            sso.updateCredentials(p, credentials.getAuthType(),
                                  credentials.getUsername(),
                                  credentials.getPassword());
         }
      }
View Full Code Here

Examples of java.security.Principal

      {
         // Get the principal username
         String username;
         if( principal instanceof Principal )
         {
            Principal p = (Principal) principal;
            username = p.getName();
         }
         else
         {
            username = principal.toString();
         }
View Full Code Here

Examples of java.security.Principal

   {
      return AccessController.doPrivileged(new PrivilegedAction<Principal>()
      {
         public Principal run()
         {
            Principal principal = null;
            SecurityContext sc = getSecurityContext();
            if(sc != null)
            {
               principal = sc.getUtil().getUserPrincipal();
            }
View Full Code Here

Examples of java.security.Principal

      throws NamingException
   {
      // Get the login principal and credentials from the JNDI env
      Object credentials = env.get(Context.SECURITY_CREDENTIALS);
      Object principal = env.get(Context.SECURITY_PRINCIPAL);
      Principal securityPrincipal = null;
      /** Flag indicating if the SecurityAssociation existing at login should
      be restored on logout.
      */
      String flag = (String) env.get("jnp.multi-threaded");
      if (Boolean.valueOf(flag).booleanValue() == true)
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.