Package org.jboss.seam.security.external.jaxb.samlv2.metadata

Examples of org.jboss.seam.security.external.jaxb.samlv2.metadata.ObjectFactory


   public void writeMetaData(Writer writer)
   {
      try
      {
         ObjectFactory metaDataFactory = new ObjectFactory();

         IndexedEndpointType acsRedirectEndpoint = metaDataFactory.createIndexedEndpointType();
         acsRedirectEndpoint.setBinding(SamlConstants.HTTP_REDIRECT_BINDING);
         acsRedirectEndpoint.setLocation(getServiceURL(SamlServiceType.SAML_ASSERTION_CONSUMER_SERVICE));

         IndexedEndpointType acsPostEndpoint = metaDataFactory.createIndexedEndpointType();
         acsPostEndpoint.setBinding(SamlConstants.HTTP_POST_BINDING);
         acsPostEndpoint.setLocation(getServiceURL(SamlServiceType.SAML_ASSERTION_CONSUMER_SERVICE));

         SPSSODescriptorType spSsoDescriptor = metaDataFactory.createSPSSODescriptorType();

         spSsoDescriptor.getAssertionConsumerService().add(acsRedirectEndpoint);
         spSsoDescriptor.getAssertionConsumerService().add(acsPostEndpoint);
         addSloEndpointsToMetaData(spSsoDescriptor);

         spSsoDescriptor.setAuthnRequestsSigned(isAuthnRequestsSigned());
         spSsoDescriptor.setWantAssertionsSigned(isWantAssertionsSigned());

         spSsoDescriptor.getProtocolSupportEnumeration().add(SamlConstants.PROTOCOL_NSURI);

         addNameIDFormatsToMetaData(spSsoDescriptor);

         if (getSigningKey() != null)
         {
            addKeyDescriptorToMetaData(spSsoDescriptor);
         }

         EntityDescriptorType entityDescriptor = metaDataFactory.createEntityDescriptorType();
         entityDescriptor.setEntityID(getEntityId());
         entityDescriptor.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor().add(spSsoDescriptor);

         Marshaller marshaller = metaDataJaxbContext.createMarshaller();
         marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
         marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
         marshaller.marshal(metaDataFactory.createEntityDescriptor(entityDescriptor), writer);
      }
      catch (JAXBException e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here


            IndexedEndpointType acsPostEndpoint = metaDataFactory.createIndexedEndpointType();
            acsPostEndpoint.setBinding(SamlConstants.HTTP_POST_BINDING);
            acsPostEndpoint.setLocation(getServiceURL(SamlServiceType.SAML_ASSERTION_CONSUMER_SERVICE));

            SPSSODescriptorType spSsoDescriptor = metaDataFactory.createSPSSODescriptorType();

            spSsoDescriptor.getAssertionConsumerService().add(acsRedirectEndpoint);
            spSsoDescriptor.getAssertionConsumerService().add(acsPostEndpoint);
            addSloEndpointsToMetaData(spSsoDescriptor);

            spSsoDescriptor.setAuthnRequestsSigned(isAuthnRequestsSigned());
            spSsoDescriptor.setWantAssertionsSigned(isWantAssertionsSigned());

            spSsoDescriptor.getProtocolSupportEnumeration().add(SamlConstants.PROTOCOL_NSURI);

            addNameIDFormatsToMetaData(spSsoDescriptor);

            if (getSigningKey() != null) {
                addKeyDescriptorToMetaData(spSsoDescriptor);
View Full Code Here

    }

    public SamlExternalServiceProvider addExternalSamlEntity(Reader reader) {
        EntityDescriptorType entityDescriptor = readEntityDescriptor(reader);
        String entityId = entityDescriptor.getEntityID();
        SPSSODescriptorType SPSSODescriptor = (SPSSODescriptorType) entityDescriptor.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor().get(0);
        return addExternalServiceProvider(entityId, SPSSODescriptor);
    }
View Full Code Here

   public SamlExternalServiceProvider addExternalSamlEntity(Reader reader)
   {
      EntityDescriptorType entityDescriptor = readEntityDescriptor(reader);
      String entityId = entityDescriptor.getEntityID();
      SPSSODescriptorType SPSSODescriptor = (SPSSODescriptorType) entityDescriptor.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor().get(0);
      return addExternalServiceProvider(entityId, SPSSODescriptor);
   }
View Full Code Here

         IndexedEndpointType acsPostEndpoint = metaDataFactory.createIndexedEndpointType();
         acsPostEndpoint.setBinding(SamlConstants.HTTP_POST_BINDING);
         acsPostEndpoint.setLocation(getServiceURL(SamlServiceType.SAML_ASSERTION_CONSUMER_SERVICE));

         SPSSODescriptorType spSsoDescriptor = metaDataFactory.createSPSSODescriptorType();

         spSsoDescriptor.getAssertionConsumerService().add(acsRedirectEndpoint);
         spSsoDescriptor.getAssertionConsumerService().add(acsPostEndpoint);
         addSloEndpointsToMetaData(spSsoDescriptor);

         spSsoDescriptor.setAuthnRequestsSigned(isAuthnRequestsSigned());
         spSsoDescriptor.setWantAssertionsSigned(isWantAssertionsSigned());

         spSsoDescriptor.getProtocolSupportEnumeration().add(SamlConstants.PROTOCOL_NSURI);

         addNameIDFormatsToMetaData(spSsoDescriptor);

         if (getSigningKey() != null)
         {
View Full Code Here

        try {
            samlRequest.setDestination(endpoint.getLocation());

            JAXBElement<?> requestElement;
            if (samlRequest instanceof AuthnRequestType) {
                AuthnRequestType authnRequest = (AuthnRequestType) samlRequest;
                requestElement = new ObjectFactory().createAuthnRequest(authnRequest);
            } else if (samlRequest instanceof LogoutRequestType) {
                LogoutRequestType logoutRequest = (LogoutRequestType) samlRequest;
                requestElement = new ObjectFactory().createLogoutRequest(logoutRequest);
            } else {
View Full Code Here

        return response;
    }

    public AuthnRequestType createAuthnRequest() {
        AuthnRequestType authnRequest = objectFactory.createAuthnRequestType();

        fillRequestAbstractTypeFields(authnRequest);

        // Fill in the optional fields that indicate where and how the response
        // should be delivered.
        authnRequest.setAssertionConsumerServiceURL(samlEntityBean.get().getServiceURL(SamlServiceType.SAML_ASSERTION_CONSUMER_SERVICE));
        authnRequest.setProtocolBinding(SamlConstants.HTTP_POST_BINDING);

        return authnRequest;
    }
View Full Code Here

            samlServiceProviderSpi.get().loginSucceeded(session, responseHandler.createResponseHolder(response));
        }
    }

    public void sendAuthenticationRequestToIDP(SamlExternalIdentityProvider idp, HttpServletResponse response) {
        AuthnRequestType authnRequest = samlMessageFactory.createAuthnRequest();

        samlDialogue.setExternalProvider(idp);

        samlMessageSender.sendRequest(idp, SamlProfile.SINGLE_SIGN_ON, authnRequest, response);
    }
View Full Code Here

        sendAuthenticationResponse(samlDialogue.getExternalProvider(), null, true, response);
    }

    @Dialogued
    public void sendAuthenticationResponseToIDP(SamlExternalIdentityProvider idp, HttpServletResponse response) {
        AuthnRequestType authnRequest = samlMessageFactory.createAuthnRequest();

        samlDialogue.setExternalProvider(idp);

        samlMessageSender.sendRequest(idp, SamlProfile.SINGLE_SIGN_ON, authnRequest, response);
    }
View Full Code Here

   }

   @Dialogued
   public void sendAuthenticationResponseToIDP(SamlExternalIdentityProvider idp, HttpServletResponse response)
   {
      AuthnRequestType authnRequest = samlMessageFactory.createAuthnRequest();

      samlDialogue.setExternalProvider(idp);

      samlMessageSender.sendRequest(idp, SamlProfile.SINGLE_SIGN_ON, authnRequest, response);
   }
View Full Code Here

TOP

Related Classes of org.jboss.seam.security.external.jaxb.samlv2.metadata.ObjectFactory

Copyright © 2018 www.massapicom. 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.