Examples of WSTrustException


Examples of org.apache.ws.sandbox.security.trust.WSTrustException

          if(el.equals(Created.TOKEN)) {
            this.createdElement = new Created(elem);
          } else if(el.equals(Expires.TOKEN)) {
            this.expiresElement = new Expires(elem);
          } else {
            throw new WSTrustException(WSTrustException.INVALID_REQUEST,
                WSTrustException.DESC_INCORRECT_CHILD_ELEM,
            new Object[] {
                TOKEN.getPrefix(),TOKEN.getLocalPart(),
            el.getNamespaceURI(),el.getLocalPart()});
          }
View Full Code Here

Examples of org.apache.ws.sandbox.security.trust.WSTrustException

    } else if(el.equals(AllowPostdating.TOKEN)) {
      this.allowPostdatingElement = new AllowPostdating(elem);
    } else if(el.equals(Lifetime.TOKEN)) {
      this.lifetimeElement = new Lifetime(elem);
    } else {
          throw new WSTrustException(WSTrustException.INVALID_REQUEST,
              WSTrustException.DESC_INCORRECT_CHILD_ELEM,
          new Object[] {
              TOKEN.getPrefix(),TOKEN.getLocalPart(),
          el.getNamespaceURI(),el.getLocalPart()});
    }
View Full Code Here

Examples of org.apache.ws.sandbox.security.trust.WSTrustException

          if(el.equals(Created.TOKEN)) {
            this.createdElement = new Created(elem);
          } else if(el.equals(Expires.TOKEN)) {
            this.expiresElement = new Expires(elem);
          } else {
            throw new WSTrustException(WSTrustException.INVALID_REQUEST,
                WSTrustException.DESC_INCORRECT_CHILD_ELEM,
            new Object[] {
                TOKEN.getPrefix(),TOKEN.getLocalPart(),
            el.getNamespaceURI(),el.getLocalPart()});
          }
View Full Code Here

Examples of org.apache.ws.sandbox.security.trust.WSTrustException

              this.endpointReferenceElement = elem;
              break;
            }
          }
        } else {
          throw new WSTrustException(WSTrustException.INVALID_REQUEST,
              WSTrustException.DESC_EXPECTED_CHILD_ELEM,
              new Object[]{
              TrustConstants.WSA_PREFIX, TrustConstants.ADDRESS_LN,
              TrustConstants.WSA_PREFIX, TrustConstants.ENDPOINT_REFERENCE_LN});
        }
      }
     

     
    } else {
      //If the Passed elemt is not a wsa:EndpointReference element
      throw new WSTrustException(WSTrustException.INVALID_REQUEST,
          WSTrustException.DESC_EXPECTED_CHILD_ELEM,
          new Object[]{
          TrustConstants.WSA_PREFIX, TrustConstants.ENDPOINT_REFERENCE_LN,
          TOKEN.getPrefix(), TOKEN.getLocalPart()});
    }
View Full Code Here

Examples of org.jboss.identity.federation.api.wstrust.WSTrustException

         else if (requestType.equals(WSTrustConstants.CANCEL_REQUEST))
            return this.marshallResponse(handler.cancel(request, this.context.getUserPrincipal()));
         else if (requestType.equals(WSTrustConstants.VALIDATE_REQUEST))
            return this.marshallResponse(handler.validate(request, this.context.getUserPrincipal()));
         else
            throw new WSTrustException("Invalid request type: " + requestType);
      }
      catch (WSTrustException we)
      {
         throw new WebServiceException("Exception in handling token request:", we);
      }
View Full Code Here

Examples of org.jboss.identity.federation.api.wstrust.WSTrustException

      {
         assertionElement = SAMLUtil.toElement(assertion);
      }
      catch (Exception e)
      {
         throw new WSTrustException("Failed to marshall SAMLV2 assertion", e);
      }

      SecurityToken token = new StandardSecurityToken(context.getRequestSecurityToken().getTokenType().toString(),
            assertionElement, assertionID);
      context.setSecurityToken(token);
View Full Code Here

Examples of org.jboss.identity.federation.api.wstrust.WSTrustException

   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";
     
View Full Code Here

Examples of org.jboss.identity.federation.core.wstrust.WSTrustException

   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;
        
         if(!this.isAssertion(assertionElement))
         {
            code = WSTrustConstants.STATUS_CODE_INVALID;
            reason = "Validation failure: supplied token is not a SAMLV2.0 Assertion";
         }
         else
         {
            try
            {
               assertion = SAMLUtil.fromElement((Element) assertionObj);
            }
            catch (JAXBException e)
            {
               throw new WSTrustException("Unmarshalling error:",e);
            }
         }
      }
    
      // check the assertion lifetime.
View Full Code Here

Examples of org.jboss.identity.federation.core.wstrust.WSTrustException

      {
         assertionElement = SAMLUtil.toElement(assertion);
      }
      catch (Exception e)
      {
         throw new WSTrustException("Failed to marshall SAMLV2 assertion", e);
      }

      SecurityToken token = new StandardSecurityToken(context.getRequestSecurityToken().getTokenType().toString(),
            assertionElement, assertionID);
      context.setSecurityToken(token);
View Full Code Here

Examples of org.jboss.identity.federation.core.wstrust.WSTrustException

         logger.trace("SAML V2.0 token validation started");
     
      // 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;
        
         if(!this.isAssertion(assertionElement))
         {
            code = WSTrustConstants.STATUS_CODE_INVALID;
            reason = "Validation failure: supplied token is not a SAMLV2.0 Assertion";
         }
         else
         {
            try
            {
               assertion = SAMLUtil.fromElement((Element) assertionObj);
            }
            catch (JAXBException e)
            {
               throw new WSTrustException("Unmarshalling error:",e);
            }
         }
      }
    
      // check the assertion lifetime.
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.