public Assertion build(OMElement element, AssertionBuilderFactory factory)
      throws IllegalArgumentException {
    TransportBinding transportBinding = new TransportBinding(SPConstants.SP_V12);

    Policy policy = PolicyEngine.getPolicy(element.getFirstElement());
    policy = (Policy) policy.normalize(false);

    for (List<PolicyComponent> alts : policy.getAlternatives()) {
      processAlternative(alts, transportBinding, factory);
      break;
    }

    return transportBinding;
  }
예제 #2
0
  public PolicyAssertion build(Element element) throws IllegalArgumentException {

    SPConstants consts =
        SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE
            : SP12Constants.INSTANCE;

    SymmetricBinding symmetricBinding = new SymmetricBinding(consts);

    Policy policy = builder.getPolicy(DOMUtils.getFirstElement(element));
    policy = (Policy) policy.normalize(false);

    for (Iterator iterator = policy.getAlternatives(); iterator.hasNext(); ) {
      processAlternatives((List) iterator.next(), symmetricBinding, consts);

      /*
       * since there should be only one alternative ..
       */
      break;
    }
    return symmetricBinding;
  }
  public Assertion build(Element element, AssertionBuilderFactory factory)
      throws IllegalArgumentException {

    SPConstants consts =
        SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE
            : SP12Constants.INSTANCE;

    RecipientSignatureToken recipientSignatureToken = new RecipientSignatureToken(consts, builder);
    recipientSignatureToken.setOptional(PolicyConstants.isOptional(element));
    recipientSignatureToken.setIgnorable(PolicyConstants.isIgnorable(element));

    Policy policy = builder.getPolicy(DOMUtils.getFirstElement(element));
    policy = policy.normalize(builder.getPolicyRegistry(), false);

    for (Iterator<List<Assertion>> iterator = policy.getAlternatives(); iterator.hasNext(); ) {
      processAlternative(iterator.next(), recipientSignatureToken);
      break; // TODO process all the token that must be set ..
    }

    return recipientSignatureToken;
  }
예제 #4
0
  public PolicyAssertion build(Element element) throws IllegalArgumentException {

    SPConstants consts =
        SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE
            : SP12Constants.INSTANCE;

    RecipientToken recipientToken = new RecipientToken(consts);

    Policy policy = builder.getPolicy(DOMUtils.getFirstElement(element));
    policy = (Policy) policy.normalize(false);

    for (Iterator iterator = policy.getAlternatives(); iterator.hasNext(); ) {
      processAlternative((List) iterator.next(), recipientToken);

      /*
       * for the moment we will pick the first token specified in the policy
       */
      break;
    }

    return recipientToken;
  }