Examples of XACMLAuthzDecisionQueryType


Examples of org.jboss.identity.federation.saml.v2.profiles.xacml.protocol.XACMLAuthzDecisionQueryType

   protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
   {
      JAXBElement<RequestAbstractType> jaxbRequestType = null;
     
      Envelope envelope = null;
      XACMLAuthzDecisionQueryType xacmlRequest = null;
     
      try
      {
         Document inputDoc = DocumentUtil.getDocument(req.getInputStream());
         if(debug)
            log.trace("Received SOAP:"+DocumentUtil.getDocumentAsString(inputDoc));
        
         Unmarshaller un = JAXBUtil.getUnmarshaller(SOAPSAMLXACMLUtil.getPackage());
         if(debug)
           un.setEventHandler(new DefaultValidationEventHandler());

         Object unmarshalledObject = un.unmarshal(DocumentUtil.getNodeAsStream(inputDoc));
        
         if(unmarshalledObject instanceof JAXBElement)
         {
            JAXBElement<?> jaxbElement = (JAXBElement<?>) unmarshalledObject;
            Object element = jaxbElement.getValue();
            if(element instanceof Envelope)
            {
               envelope = (Envelope)element;
               Body soapBody = envelope.getBody();
               Object samlRequest = soapBody.getAny().get(0);
               if(samlRequest instanceof JAXBElement)
               {
                  jaxbRequestType = (JAXBElement<RequestAbstractType>)samlRequest;
                  jaxbRequestType = (JAXBElement<RequestAbstractType>)samlRequest;
                  xacmlRequest = (XACMLAuthzDecisionQueryType) jaxbRequestType.getValue();
               }
               else
                  if(samlRequest instanceof Element)
                  {
                     Element elem = (Element) samlRequest;
                     xacmlRequest = SOAPSAMLXACMLUtil.getXACMLQueryType(elem);
                  }
            }
            else if(element instanceof XACMLAuthzDecisionQueryType)
            {
               xacmlRequest = (XACMLAuthzDecisionQueryType) element;
            }
         }
         if(xacmlRequest == null)
            throw new IOException("XACML Request not parsed");

         RequestType requestType = xacmlRequest.getRequest();
        
         RequestContext requestContext = new JBossRequestContext();
         requestContext.setRequest(requestType);
        
         //pdp evaluation is thread safe
View Full Code Here

Examples of org.jboss.identity.federation.saml.v2.profiles.xacml.protocol.XACMLAuthzDecisionQueryType

    */
   public Result send(String endpoint, String issuer, RequestType xacmlRequest) throws ProcessingException
   {
      try
      {
         XACMLAuthzDecisionQueryType queryType = SOAPSAMLXACMLUtil.createXACMLAuthzDecisionQueryType();
         queryType.setRequest(xacmlRequest);
        
         //Create Issue Instant
         queryType.setIssueInstant(XMLTimeUtil.getIssueInstant());
        
         //Create Issuer
         NameIDType nameIDType = SAMLAssertionFactory.getObjectFactory().createNameIDType();
         nameIDType.setValue(issuer);
         queryType.setIssuer(nameIDType);
        
         JAXBElement<?> jaxbQueryType = SOAPSAMLXACMLUtil.getJAXB(queryType);
        
         Envelope envelope = createEnvelope(jaxbQueryType);
        
View Full Code Here

Examples of org.jboss.identity.federation.saml.v2.profiles.xacml.protocol.XACMLAuthzDecisionQueryType

    */
   public Result send(String endpoint, String issuer, RequestType xacmlRequest) throws ProcessingException
   {
      try
      {
         XACMLAuthzDecisionQueryType queryType = SOAPSAMLXACMLUtil.createXACMLAuthzDecisionQueryType();
         queryType.setRequest(xacmlRequest);
        
         //Create Issue Instant
         queryType.setIssueInstant(XMLTimeUtil.getIssueInstant());
        
         //Create Issuer
         NameIDType nameIDType = SAMLAssertionFactory.getObjectFactory().createNameIDType();
         nameIDType.setValue(issuer);
         queryType.setIssuer(nameIDType);
        
         JAXBElement<?> jaxbQueryType = SOAPSAMLXACMLUtil.getJAXB(queryType);
        
         Envelope envelope = createEnvelope(jaxbQueryType);
        
View Full Code Here

Examples of org.jboss.identity.federation.saml.v2.profiles.xacml.protocol.XACMLAuthzDecisionQueryType

   protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
   {
      JAXBElement<RequestAbstractType> jaxbRequestType = null;
     
      Envelope envelope = null;
      XACMLAuthzDecisionQueryType xacmlRequest = null;
     
      try
      {
         Document inputDoc = DocumentUtil.getDocument(req.getInputStream());
         if(debug && trace)
            log.trace("Received SOAP:"+DocumentUtil.getDocumentAsString(inputDoc));
        
         Unmarshaller un = JAXBUtil.getUnmarshaller(SOAPSAMLXACMLUtil.getPackage());
         if(debug)
           un.setEventHandler(new DefaultValidationEventHandler());

         Object unmarshalledObject = un.unmarshal(DocumentUtil.getNodeAsStream(inputDoc));
        
         if(unmarshalledObject instanceof JAXBElement)
         {
            JAXBElement<?> jaxbElement = (JAXBElement<?>) unmarshalledObject;
            Object element = jaxbElement.getValue();
            if(element instanceof Envelope)
            {
               envelope = (Envelope)element;
               Body soapBody = envelope.getBody();
               Object samlRequest = soapBody.getAny().get(0);
               if(samlRequest instanceof JAXBElement)
               {
                  jaxbRequestType = (JAXBElement<RequestAbstractType>)samlRequest;
                  jaxbRequestType = (JAXBElement<RequestAbstractType>)samlRequest;
                  xacmlRequest = (XACMLAuthzDecisionQueryType) jaxbRequestType.getValue();
               }
               else
                  if(samlRequest instanceof Element)
                  {
                     Element elem = (Element) samlRequest;
                     xacmlRequest = SOAPSAMLXACMLUtil.getXACMLQueryType(elem);
                  }
            }
            else if(element instanceof XACMLAuthzDecisionQueryType)
            {
               xacmlRequest = (XACMLAuthzDecisionQueryType) element;
            }
         }
         if(xacmlRequest == null)
            throw new IOException("XACML Request not parsed");

         RequestType requestType = xacmlRequest.getRequest();
        
         RequestContext requestContext = new JBossRequestContext();
         requestContext.setRequest(requestType);
        
         //pdp evaluation is thread safe
View Full Code Here

Examples of org.jboss.security.xacml.saml.integration.opensaml.types.XACMLAuthzDecisionQueryType

   /** {@inheritDoc} */
   protected void processChildElement(XMLObject parentObject,
         XMLObject childObject) throws UnmarshallingException
   {
       XACMLAuthzDecisionQueryType xacmlauthzdecisionquery = (XACMLAuthzDecisionQueryType) parentObject;

       if (childObject instanceof RequestContext) {
           xacmlauthzdecisionquery.setRequest((RequestContext) childObject);
       } else {
           super.processChildElement(parentObject, childObject);
       }
   }
View Full Code Here

Examples of org.jboss.security.xacml.saml.integration.opensaml.types.XACMLAuthzDecisionQueryType

   }

   @Override
   protected void unmarshallChildElement(XMLObject xmlObject, Element childElement) throws UnmarshallingException
   {
      XACMLAuthzDecisionQueryType xacmlAuthzDecisionQueryType = null;
      if(xmlObject instanceof XACMLAuthzDecisionQueryType)
      {
         xacmlAuthzDecisionQueryType = (XACMLAuthzDecisionQueryType) xmlObject;
      }
      if(childElement.getLocalName().equals("Request")
            && childElement.getNamespaceURI().equals(XACMLConstants.CONTEXT_SCHEMA))
      {
         //process the xacml request
         RequestContext requestContext = RequestResponseContextFactory.createRequestCtx();
         try
         {
            requestContext.readRequest(childElement);
         }
         catch (IOException e)
         {
            throw new RuntimeException(e);
         }
         xacmlAuthzDecisionQueryType.setRequest(requestContext);
      }
      else
      super.unmarshallChildElement(xmlObject, childElement);
   }
View Full Code Here

Examples of org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType

       
        //
        // Create SAML wrapper
        //
       
        XACMLAuthzDecisionQueryType authzQuery =
            SamlRequestComponentBuilder.createAuthzDecisionQuery(
                    "Issuer", request, SAMLProfileConstants.SAML20XACML20P_NS
            );
       
        Element policyElement = OpenSAMLUtil.toDom(authzQuery, doc);
View Full Code Here

Examples of org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType

       
        //
        // Create SAML wrapper
        //
       
        XACMLAuthzDecisionQueryType authzQuery =
            SamlRequestComponentBuilder.createAuthzDecisionQuery(
                    "Issuer", request, SAMLProfileConstants.SAML20XACML20P_NS
            );
       
        Element policyElement = OpenSAMLUtil.toDom(authzQuery, doc);
View Full Code Here

Examples of org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType

*/
public class XACMLAuthzDecisionQueryTypeUnmarshaller extends RequestAbstractTypeUnmarshaller {

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
        XACMLAuthzDecisionQueryType xacmlauthzdecisionquery = (XACMLAuthzDecisionQueryType) parentObject;

        if (childObject instanceof RequestType) {
            xacmlauthzdecisionquery.setRequest((RequestType) childObject);
        } else if (childObject instanceof PolicyType) {
            xacmlauthzdecisionquery.getPolicies().add((PolicyType) childObject);
        } else if (childObject instanceof PolicySetType) {
            xacmlauthzdecisionquery.getPolicySets().add((PolicySetType) childObject);
        } else if (childObject instanceof ReferencedPoliciesType) {
            xacmlauthzdecisionquery.setReferencedPolicies((ReferencedPoliciesType) childObject);
        } else {
            super.processChildElement(parentObject, childObject);
        }
    }
View Full Code Here

Examples of org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType

        }
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
        XACMLAuthzDecisionQueryType authzDS = (XACMLAuthzDecisionQueryType) samlObject;

        if (attribute.getLocalName().equals(XACMLAuthzDecisionQueryType.INPUTCONTEXTONLY_ATTRIB_NAME)) {
            authzDS.setInputContextOnly(XSBooleanValue.valueOf(attribute.getValue()));
        }

        if (attribute.getLocalName().equals(XACMLAuthzDecisionQueryType.RETURNCONTEXT_ATTRIB_NAME)) {
            authzDS.setReturnContext(XSBooleanValue.valueOf(attribute.getValue()));
        }

        if (attribute.getLocalName().equals(XACMLAuthzDecisionQueryType.COMBINEPOLICIES_ATTRIB_NAME)) {
            authzDS.setCombinePolicies(XSBooleanValue.valueOf(attribute.getValue()));
        }

        super.processAttribute(samlObject, attribute);
    }
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.