Package org.jboss.ws.metadata.wsse

Examples of org.jboss.ws.metadata.wsse.Config


      Operation operation = port.getOperations().get(opName != null ? opName.toString() : null);
      if (operation == null)
      {
         //if the operation name was not available or didn't match any wsse configured operation,
         //we fall back to the port wsse config (if available) or the default config.
         Config portConfig = port.getDefaultConfig();
         return (portConfig == null) ? configuration.getDefaultConfig() : portConfig;

      }
      return operation.getConfig();
   }
View Full Code Here


/*  90 */       return config.getDefaultConfig();
/*     */     }
/*  92 */     Operation operation = (Operation)port.getOperations().get(opName);
/*  93 */     if (operation == null)
/*     */     {
/*  95 */       Config portConfig = port.getDefaultConfig();
/*  96 */       return portConfig == null ? config.getDefaultConfig() : portConfig;
/*     */     }
/*     */
/* 100 */     return operation.getConfig();
/*     */   }
View Full Code Here

/* 187 */     return config;
/*     */   }
/*     */
/*     */   private static boolean hasRequirements(WSSecurityConfiguration config, String operation, String port)
/*     */   {
/* 192 */     Config operationConfig = getConfig(config, port, operation);
/* 193 */     return (operationConfig != null) && (operationConfig.getRequires() != null);
/*     */   }
View Full Code Here

/* 193 */     return (operationConfig != null) && (operationConfig.getRequires() != null);
/*     */   }
/*     */
/*     */   private static List<OperationDescription<RequireOperation>> buildRequireOperations(WSSecurityConfiguration config, String operation, String port)
/*     */   {
/* 198 */     Config operationConfig = getConfig(config, port, operation);
/* 199 */     if (operationConfig == null) {
/* 200 */       return null;
/*     */     }
/* 202 */     Requires requires = operationConfig.getRequires();
/* 203 */     if (requires == null) {
/* 204 */       return null;
/*     */     }
/* 206 */     ArrayList operations = new ArrayList();
/* 207 */     RequireTimestamp requireTimestamp = requires.getRequireTimestamp();
View Full Code Here

/* 236 */     String opName = null;
/* 237 */     OperationMetaData opMetaData = ctx.getOperationMetaData();
/* 238 */     if (opMetaData != null) {
/* 239 */       opName = opMetaData.getQName().toString();
/*     */     }
/* 241 */     Config opConfig = getConfig(config, port, opName);
/* 242 */     log.debug("WS-Security config: " + opConfig);
/*     */
/* 245 */     if (opConfig == null) {
/* 246 */       return;
/*     */     }
/* 248 */     ArrayList operations = new ArrayList();
/* 249 */     Timestamp timestamp = opConfig.getTimestamp();
/* 250 */     if (timestamp != null)
/*     */     {
/* 252 */       operations.add(new OperationDescription(TimestampOperation.class, null, null, timestamp.getTtl(), null));
/*     */     }
/*     */
/* 255 */     if (opConfig.getUsername() != null)
/*     */     {
/* 257 */       Object user = ctx.get("javax.xml.rpc.security.auth.username");
/* 258 */       Object pass = ctx.get("javax.xml.rpc.security.auth.password");
/*     */
/* 260 */       if ((user == null) && (pass == null))
/*     */       {
/* 262 */         user = ctx.get("javax.xml.ws.security.auth.username");
/* 263 */         pass = ctx.get("javax.xml.ws.security.auth.password");
/*     */       }
/*     */
/* 266 */       if ((user != null) && (pass != null))
/*     */       {
/* 268 */         operations.add(new OperationDescription(SendUsernameOperation.class, null, user.toString(), pass.toString(), null));
/* 269 */         ctx.put("org.jboss.ws.authType", "org.jboss.ws.authType.wsse");
/*     */       }
/*     */     }
/*     */
/* 273 */     Sign sign = opConfig.getSign();
/* 274 */     if (sign != null)
/*     */     {
/* 276 */       List targets = convertTargets(sign.getTargets());
/* 277 */       if (sign.isIncludeTimestamp())
/*     */       {
/* 279 */         if (timestamp == null) {
/* 280 */           operations.add(new OperationDescription(TimestampOperation.class, null, null, null, null));
/*     */         }
/* 282 */         if ((targets != null) && (targets.size() > 0)) {
/* 283 */           targets.add(new WsuIdTarget("timestamp"));
/*     */         }
/*     */       }
/* 286 */       operations.add(new OperationDescription(SignatureOperation.class, targets, sign.getAlias(), null, null));
/*     */     }
/*     */
/* 289 */     Encrypt encrypt = opConfig.getEncrypt();
/* 290 */     if (encrypt != null)
/*     */     {
/* 292 */       List targets = convertTargets(encrypt.getTargets());
/* 293 */       operations.add(new OperationDescription(EncryptionOperation.class, targets, encrypt.getAlias(), null, encrypt.getAlgorithm()));
/*     */     }
View Full Code Here

         return config.getDefaultConfig();

      Operation operation = port.getOperations().get(opName);
      if (operation == null)
      {
         Config portConfig = port.getDefaultConfig();
         return (portConfig == null) ? config.getDefaultConfig() : portConfig;

      }

      return operation.getConfig();
View Full Code Here

   public static void handleInbound(CommonMessageContext ctx) throws SOAPException, SOAPFaultException
   {
      WSSecurityConfiguration config = getSecurityConfig(ctx);
      SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
      Config actualConfig = getActualConfig(config, null);

      SOAPHeader soapHeader = soapMessage.getSOAPHeader();
      QName secQName = new QName(Constants.WSSE_NS, "Security");

      Element secHeaderElement = (soapHeader != null) ? Util.findElement(soapHeader, secQName) : null;
     
      if (secHeaderElement == null)
      {
         // This is ok, we always allow faults to be received because WS-Security does not encrypt faults
         if (soapMessage.getSOAPBody().getFault() != null)
            return;

         OperationMetaData opMetaData = ctx.getOperationMetaData();
         if (opMetaData == null)
         {
            // Get the operation meta data from the soap message
            // for the server side inbound message.
            EndpointMetaData epMetaData = ctx.getEndpointMetaData();
            opMetaData = soapMessage.getOperationMetaData(epMetaData);
         }

         String operation = null;
         String port = null;
         if (opMetaData != null)
         {
            operation = opMetaData.getQName().toString();
            port = opMetaData.getEndpointMetaData().getPortName().getLocalPart();
         }
         

         if (hasRequirements(config, operation, port))
            throw convertToFault(new InvalidSecurityHeaderException("This service requires <wsse:Security>, which is missing."));
      }

      try
      {

         Config operationConfig = getConfig(ctx, config, soapMessage);
         if (secHeaderElement != null)
         {
            decodeHeader(ctx, config, operationConfig, soapMessage, secHeaderElement);
         }
View Full Code Here

      Operation operation = port.getOperations().get(opName != null ? opName.toString() : null);
      if (operation == null)
      {
         //if the operation name was not available or didn't match any wsse configured operation,
         //we fall back to the port wsse config (if available) or the default config.
         Config portConfig = port.getDefaultConfig();
         return (portConfig == null) ? configuration.getDefaultConfig() : portConfig;

      }
      return operation.getConfig();
   }
View Full Code Here

      return operation.getConfig();
   }

   private static boolean hasRequirements(WSSecurityConfiguration config, String operation, String port)
   {
      Config operationConfig = getConfig(config, port, operation);
      return (operationConfig != null && operationConfig.getRequires() != null);
   }
View Full Code Here

      return (operationConfig != null && operationConfig.getRequires() != null);
   }

   private static List<OperationDescription<RequireOperation>> buildRequireOperations(WSSecurityConfiguration config, String operation, String port)
   {     
    Config operationConfig = getConfig(config, port, operation);
      if (operationConfig == null)
         return null;

      Requires requires = operationConfig.getRequires();
      if (requires == null)
         return null;

      ArrayList<OperationDescription<RequireOperation>> operations = new ArrayList<OperationDescription<RequireOperation>>();
      RequireTimestamp requireTimestamp = requires.getRequireTimestamp();
View Full Code Here

TOP

Related Classes of org.jboss.ws.metadata.wsse.Config

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.