Examples of Principal


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

         Subject serviceSubject) throws AuthException
   {
      Request request = (Request) messageInfo.getRequestMessage();
      Response response = (Response) messageInfo.getResponseMessage();
    
      Principal principal;
      context = request.getContext();
      LoginConfig config = context.getLoginConfig();
      
      // References to objects we will need later
      Session session = null;
View Full Code Here

Examples of java.security.Principal

   {
      //References to objects we will need later
      Session session = null;

      // Have we already authenticated someone?
      Principal principal = request.getUserPrincipal();
      String ssoId = (String) request.getNote(Constants.REQ_SSOID_NOTE);
      if (principal != null) {
          if (log.isDebugEnabled())
              log.debug("Already authenticated '" +
                  principal.getName() + "'");
          // Associate the session with any existing SSO session
          if (ssoId != null)
              associate(ssoId, request.getSessionInternal(true));
          return (true);
      }
View Full Code Here

Examples of java.security.Principal

      {
         Subject caller = (Subject) PolicyContext.getContext(SUBJECT_CONTEXT_KEY);
         Iterator iter = caller.getPrincipals().iterator();
         while(iter != null && iter.hasNext())
         {
            Principal p = (Principal)iter.next();
            if(p instanceof SimpleGroup)
            {
               SimpleGroup sg = (SimpleGroup)p;
               String name = sg.getName();
               if("Roles".equals(name))
View Full Code Here

Examples of java.security.Principal

   private static class GetPrincipalAction implements PrivilegedAction
   {
      static PrivilegedAction ACTION = new GetPrincipalAction();
      public Object run()
      {
         Principal principal = SecurityAssociation.getPrincipal();
         return principal;
      }
View Full Code Here

Examples of java.security.Principal

         Principal principal = SecurityAssociation.getPrincipal();
         return principal;
      }
      static Principal getPrincipal()
      {
         Principal principal = (Principal) AccessController.doPrivileged(ACTION);
         return principal;
      }
View Full Code Here

Examples of java.security.Principal

   public void doFilter(ServletRequest request, ServletResponse response,
      FilterChain chain)
      throws IOException, ServletException
   {
      HttpServletRequest httpRequest = (HttpServletRequest) request;
      Principal user = httpRequest.getUserPrincipal();
      // If there was a read-only context specified validate access
      if( user == null && readOnlyContext != null )
      {
         // Extract the invocation
         ServletInputStream sis = request.getInputStream();
View Full Code Here

Examples of java.security.Principal

      iter = requiredRoles.iterator();
      boolean hasRole = false;
      while( iter.hasNext() && hasRole == false )
      {
         Principal p = (Principal) iter.next();
         hasRole = roles.isMember(p);
      }
      if( hasRole == false )
      {
         throw new SecurityException("Authorization failure, requiredRoles="+requiredRoles
View Full Code Here

Examples of java.security.Principal

               mi.setMethodMap(marshalledInvocationMapping);
            }
            // Invoke the MBeanServer method via reflection
            Method method = invocation.getMethod();
            Object[] args = invocation.getArguments();
            Principal principal = invocation.getPrincipal();
            Object credential = invocation.getCredential();
            Object value = null;
            SecurityContext sc = SecurityActions.createSecurityContext(SecurityConstants.DEFAULT_APPLICATION_POLICY);
            SecurityActions.setSecurityContext(sc);
            // Associate the method
View Full Code Here

Examples of java.security.Principal

         if (opName.equals("invoke"))
         {
            Object[] args = invocation.getArgs();
            org.jboss.invocation.Invocation inv = (org.jboss.invocation.Invocation) args[0];
            // Authenticate the caller based on the security association
            Principal caller = inv.getPrincipal();
            Object credential = inv.getCredential();
            subject = new Subject();
            boolean isValid = securityMgr.isValid(caller, credential, subject);
            if (isValid == false)
            {
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.