Examples of StatusResponseType


Examples of org.jboss.seam.security.external.jaxb.samlv2.protocol.StatusResponseType

    public void handleSucceededAuthentication(SamlIdpSession session, HttpServletResponse response) {
        sendAuthenticationResponse(samlDialogue.getExternalProvider(), session, false, response);
    }

    private void sendAuthenticationResponse(SamlExternalEntity serviceProvider, SamlIdpSession session, boolean failed, HttpServletResponse response) {
        StatusResponseType statusResponse;

        if (failed) {
            statusResponse = samlMessageFactory.createStatusResponse(SamlConstants.STATUS_RESPONDER, null);
        } else {
            SamlService service = serviceProvider.getService(SamlProfile.SINGLE_SIGN_ON);
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.protocol.StatusResponseType

    }

    private void finishSingleLogoutProcess(HttpServletResponse response) {
        boolean failed = samlIdpIncomingLogoutDialogue.get().isFailed();
        if (samlDialogue.get().getExternalProvider() != null) {
            StatusResponseType statusResponse = samlMessageFactory.createStatusResponse(failed ? SamlConstants.STATUS_RESPONDER : SamlConstants.STATUS_SUCCESS, null);
            samlMessageSender.sendResponse(samlDialogue.get().getExternalProvider(), statusResponse, SamlProfile.SINGLE_LOGOUT, response);
        } else {
            if (failed) {
                samlIdentityProviderSpi.get().globalLogoutFailed(responseHandler.createResponseHolder(response));
            } else {
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.protocol.StatusResponseType

      sendAuthenticationResponse(samlDialogue.getExternalProvider(), session, false, response);
   }

   private void sendAuthenticationResponse(SamlExternalEntity serviceProvider, SamlIdpSession session, boolean failed, HttpServletResponse response)
   {
      StatusResponseType statusResponse;

      if (failed)
      {
         statusResponse = samlMessageFactory.createStatusResponse(SamlConstants.STATUS_RESPONDER, null);
      }
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.protocol.StatusResponseType

   private void finishSingleLogoutProcess(HttpServletResponse response)
   {
      boolean failed = samlIdpIncomingLogoutDialogue.get().isFailed();
      if (samlDialogue.get().getExternalProvider() != null)
      {
         StatusResponseType statusResponse = samlMessageFactory.createStatusResponse(failed ? SamlConstants.STATUS_RESPONDER : SamlConstants.STATUS_SUCCESS, null);
         samlMessageSender.sendResponse(samlDialogue.get().getExternalProvider(), statusResponse, SamlProfile.SINGLE_LOGOUT, response);
      }
      else
      {
         if (failed)
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.protocol.StatusResponseType

      }

      Document document = getDocument(is);
      String issuerEntityId;
      RequestAbstractType samlRequestMessage = null;
      StatusResponseType samlResponseMessage = null;
      if (samlRequestOrResponse.isRequest())
      {
         samlRequestMessage = getSamlRequest(document);
         issuerEntityId = samlRequestMessage.getIssuer().getValue();
      }
      else
      {
         samlResponseMessage = getSamlResponse(document);
         issuerEntityId = samlResponseMessage.getIssuer().getValue();
      }
      log.debug("Received: " + SamlUtils.getDocumentAsString(document));

      try
      {
         if (samlRequestOrResponse.isRequest() || samlResponseMessage.getInResponseTo() == null)
         {
            // Request or unsolicited response

            String destination = samlRequestOrResponse.isRequest() ? samlRequestMessage.getDestination() : samlResponseMessage.getDestination();
            if (!samlEntityBean.get().getServiceURL(service).equals(destination))
            {
               throw new InvalidRequestException("Destination (" + destination + ") is not valid.");
            }

            dialogueManager.beginDialogue();
            samlDialogue.get().setExternalProviderMessageId(samlRequestOrResponse.isRequest() ? samlRequestMessage.getID() : samlResponseMessage.getID());
            SamlExternalEntity externalProvider = samlEntityBean.get().getExternalSamlEntityByEntityId(issuerEntityId);
            if (externalProvider == null)
            {
               throw new InvalidRequestException("Received message from unknown entity id " + issuerEntityId);
            }
            samlDialogue.get().setExternalProvider(externalProvider);
         }
         else
         {
            String dialogueId = samlResponseMessage.getInResponseTo();
            if (!dialogueManager.isExistingDialogue(dialogueId))
            {
               throw new InvalidRequestException("No request that corresponds with the received response");
            }
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.protocol.StatusResponseType

      try
      {
         Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
         @SuppressWarnings("unchecked")
         JAXBElement<StatusResponseType> jaxbResponseType = (JAXBElement<StatusResponseType>) unmarshaller.unmarshal(document);
         StatusResponseType statusResponse = jaxbResponseType.getValue();
         return statusResponse;
      }
      catch (JAXBException e)
      {
         throw new InvalidRequestException("SAML message could not be parsed", e);
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.protocol.StatusResponseType

      NameIDType nameIdJaxb = logoutRequest.getNameID();
      SamlNameId samlNameId = new SamlNameIdImpl(nameIdJaxb.getValue(), nameIdJaxb.getFormat(), nameIdJaxb.getNameQualifier());
      removeSessions(samlNameId, idp.getEntityId(), logoutRequest.getSessionIndex());

      StatusResponseType statusResponse = samlMessageFactory.createStatusResponse(SamlConstants.STATUS_SUCCESS, null);

      samlMessageSender.sendResponse(idp, statusResponse, SamlProfile.SINGLE_LOGOUT, httpResponse);

      dialogue.setFinished(true);
   }
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.protocol.StatusResponseType

   private org.jboss.seam.security.external.jaxb.samlv2.assertion.ObjectFactory assertionObjectFactory = new org.jboss.seam.security.external.jaxb.samlv2.assertion.ObjectFactory();

   public StatusResponseType createStatusResponse(String statusCode, String statusMessage)
   {
      StatusResponseType response = objectFactory.createStatusResponseType();

      fillStatusResponseFields(response, statusCode, statusMessage);

      return response;
   }
View Full Code Here

Examples of org.opensaml.saml2.core.StatusResponseType

*/
public abstract class StatusResponseTypeUnmarshaller extends AbstractSAMLObjectUnmarshaller {

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

        if (attribute.getLocalName().equals(StatusResponseType.VERSION_ATTRIB_NAME)) {
            sr.setVersion(SAMLVersion.valueOf(attribute.getValue()));
        } else if (attribute.getLocalName().equals(StatusResponseType.ID_ATTRIB_NAME)) {
            sr.setID(attribute.getValue());
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        } else if (attribute.getLocalName().equals(StatusResponseType.IN_RESPONSE_TO_ATTRIB_NAME)) {
            sr.setInResponseTo(attribute.getValue());
        } else if (attribute.getLocalName().equals(StatusResponseType.ISSUE_INSTANT_ATTRIB_NAME)
                && !DatatypeHelper.isEmpty(attribute.getValue())) {
            sr.setIssueInstant(new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC()));
        } else if (attribute.getLocalName().equals(StatusResponseType.DESTINATION_ATTRIB_NAME)) {
            sr.setDestination(attribute.getValue());
        } else if (attribute.getLocalName().equals(StatusResponseType.CONSENT_ATTRIB_NAME)) {
            sr.setConsent(attribute.getValue());
        } else {
            super.processAttribute(samlObject, attribute);
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.StatusResponseType

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
            throws UnmarshallingException {
        StatusResponseType sr = (StatusResponseType) parentSAMLObject;

        if (childSAMLObject instanceof Issuer) {
            sr.setIssuer((Issuer) childSAMLObject);
        } else if (childSAMLObject instanceof Signature) {
            sr.setSignature((Signature) childSAMLObject);
        } else if (childSAMLObject instanceof Extensions) {
            sr.setExtensions((Extensions) childSAMLObject);
        } else if (childSAMLObject instanceof Status) {
            sr.setStatus((Status) childSAMLObject);
        } else {
            super.processChildElement(parentSAMLObject, childSAMLObject);
        }
    }
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.