Examples of ValidateTargetType


Examples of org.apache.cxf.ws.security.sts.provider.model.ValidateTargetType

            );
        request.getAny().add(tokenType);
       
        // Create a UsernameToken
        JAXBElement<UsernameTokenType> usernameTokenType = createUsernameToken("alice", "clarinet");
        ValidateTargetType validateTarget = new ValidateTargetType();
        validateTarget.setAny(usernameTokenType);
       
        JAXBElement<ValidateTargetType> validateTargetType =
            new JAXBElement<ValidateTargetType>(
                QNameConstants.VALIDATE_TARGET, ValidateTargetType.class, validateTarget
            );
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.ValidateTargetType

            );
        request.getAny().add(tokenType);
       
        // Create a UsernameToken
        JAXBElement<UsernameTokenType> usernameTokenType = createUsernameToken("alice", "badpassword");
        ValidateTargetType validateTarget = new ValidateTargetType();
        validateTarget.setAny(usernameTokenType);
       
        JAXBElement<ValidateTargetType> validateTargetType =
            new JAXBElement<ValidateTargetType>(
                QNameConstants.VALIDATE_TARGET, ValidateTargetType.class, validateTarget
            );
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.ValidateTargetType

            );
        request.getAny().add(tokenType);
       
        // Create a UsernameToken
        JAXBElement<UsernameTokenType> usernameTokenType = createUsernameToken("alice", "clarinet");
        ValidateTargetType validateTarget = new ValidateTargetType();
        validateTarget.setAny(usernameTokenType);
       
        JAXBElement<ValidateTargetType> validateTargetType =
            new JAXBElement<ValidateTargetType>(
                QNameConstants.VALIDATE_TARGET, ValidateTargetType.class, validateTarget
            );
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.ValidateTargetType

            );
        request.getAny().add(tokenType);
       
        // Create a UsernameToken
        JAXBElement<UsernameTokenType> usernameTokenType = createUsernameToken("alice", "badpassword");
        ValidateTargetType validateTarget = new ValidateTargetType();
        validateTarget.setAny(usernameTokenType);
       
        JAXBElement<ValidateTargetType> validateTargetType =
            new JAXBElement<ValidateTargetType>(
                QNameConstants.VALIDATE_TARGET, ValidateTargetType.class, validateTarget
            );
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.ValidateTargetType

        // Get a SecurityContextToken via the SCTProvider
        TokenProviderResponse providerResponse = createSCT();
        Element sct = providerResponse.getToken();
        Document doc = sct.getOwnerDocument();
        sct = (Element)doc.appendChild(sct);
        ValidateTargetType validateTarget = new ValidateTargetType();
        validateTarget.setAny(sct);
       
        JAXBElement<ValidateTargetType> validateTargetType =
            new JAXBElement<ValidateTargetType>(
                QNameConstants.VALIDATE_TARGET, ValidateTargetType.class, validateTarget
            );
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.ValidateTargetType

                lifetime.setExpires(lifetimeType.getExpires().getValue());
            }
            tokenRequirements.setLifetime(lifetime);
            LOG.fine("Found Lifetime element");
        } else if (QNameConstants.VALIDATE_TARGET.equals(jaxbElement.getName())) {
            ValidateTargetType validateTargetType = (ValidateTargetType)jaxbElement.getValue();
            ReceivedToken validateTarget = new ReceivedToken(validateTargetType.getAny());
            if (isTokenReferenced(validateTarget.getToken())) {
                Element target = fetchTokenElementFromReference(validateTarget.getToken(), wsContext);
                validateTarget = new ReceivedToken(target);
           
            tokenRequirements.setValidateTarget(validateTarget);
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.ValidateTargetType

                lifetime.setExpires(lifetimeType.getExpires().getValue());
            }
            tokenRequirements.setLifetime(lifetime);
            LOG.fine("Found Lifetime element");
        } else if (QNameConstants.VALIDATE_TARGET.equals(jaxbElement.getName())) {
            ValidateTargetType validateTargetType = (ValidateTargetType)jaxbElement.getValue();
            ReceivedToken validateTarget = new ReceivedToken(validateTargetType.getAny());
            if (isTokenReferenced(validateTarget.getToken())) {
                Element target = fetchTokenElementFromReference(validateTarget.getToken(), wsContext);
                validateTarget = new ReceivedToken(target);
           
            tokenRequirements.setValidateTarget(validateTarget);
View Full Code Here

Examples of org.jboss.identity.federation.ws.trust.ValidateTargetType

    */
   @SuppressWarnings("unchecked")
   public void validateToken(WSTrustRequestContext context) throws WSTrustException
   {
      // get the SAML assertion that must be validated.
      ValidateTargetType validateTarget = context.getRequestSecurityToken().getValidateTarget();
      if(validateTarget == null)
         throw new WSTrustException("Invalid validate message: missing required ValidateTarget");
    
      String code = WSTrustConstants.STATUS_CODE_VALID;
      String reason = "SAMLV2.0 Assertion successfuly validated";
     
      AssertionType assertion = null;
     
      Object assertionObj = validateTarget.getAny();
      if(assertionObj instanceof JAXBElement)
      {
         JAXBElement<AssertionType> assertionType = (JAXBElement<AssertionType>) validateTarget.getAny();
         assertion = assertionType.getValue();           
      }
      else if(assertionObj instanceof Element)
      {
         Element assertionElement = (Element) assertionObj;
View Full Code Here

Examples of org.jboss.identity.federation.ws.trust.ValidateTargetType

    * @see org.jboss.identity.federation.api.wstrust.SecurityTokenProvider#validateToken(org.jboss.identity.federation.api.wstrust.WSTrustRequestContext)
    */
   public void validateToken(WSTrustRequestContext context) throws WSTrustException
   {
      // get the SAML assertion that must be validated.
      ValidateTargetType validateTarget = context.getRequestSecurityToken().getValidateTarget();
      if(validateTarget == null)
         throw new WSTrustException("Invalid validate message: missing required ValidateTarget");
      Element assertionElement = (Element) validateTarget.getAny();
     
      String code = WSTrustConstants.STATUS_CODE_VALID;
      String reason = "SAMLV2.0 Assertion successfuly validated";
     
      if(!this.isAssertion(assertionElement))
View Full Code Here

Examples of org.jboss.identity.federation.ws.trust.ValidateTargetType

        RequestSecurityToken request = new RequestSecurityToken();
        request.setContext("context");

        request.setTokenType(URI.create(WSTrustConstants.STATUS_TYPE));
        request.setRequestType(URI.create(WSTrustConstants.VALIDATE_REQUEST));
        ValidateTargetType validateTarget = new ValidateTargetType();
        validateTarget.setAny(token);
        request.setValidateTarget(validateTarget);

        WSTrustJAXBFactory jaxbFactory = WSTrustJAXBFactory.getInstance();

        DOMSource requestSource = (DOMSource) jaxbFactory.marshallRequestSecurityToken(request);
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.