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

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


        subject.getContent().add(assertionObjectFactory.createNameID(nameID));
        nameID.setValue(session.getPrincipal().getNameId().getValue());
        nameID.setFormat(session.getPrincipal().getNameId().getFormat());
        nameID.setNameQualifier(session.getPrincipal().getNameId().getQualifier());

        SubjectConfirmationType subjectConfirmation = assertionObjectFactory.createSubjectConfirmationType();
        subject.getContent().add(assertionObjectFactory.createSubjectConfirmation(subjectConfirmation));
        subjectConfirmation.setMethod(SamlConstants.CONFIRMATION_METHOD_BEARER);
        subjectConfirmation.setNameID(nameID);

        SubjectConfirmationDataType subjectConfirmationData = assertionObjectFactory.createSubjectConfirmationDataType();
        subjectConfirmation.setSubjectConfirmationData(subjectConfirmationData);

        subjectConfirmationData.setRecipient(externalSamlEndpoint.getLocation());
        subjectConfirmationData.setNotOnOrAfter(SamlUtils.getXMLGregorianCalendarNowPlusDuration(GregorianCalendar.MINUTE, ASSERTION_VALIDITY_IN_MINUTES));
        subjectConfirmationData.setInResponseTo(samlDialogue.get().getExternalProviderMessageId());
View Full Code Here


        for (JAXBElement<?> contentElement : assertion.getSubject().getContent()) {
            if (contentElement.getValue() instanceof NameIDType) {
                nameId = (NameIDType) contentElement.getValue();
            }
            if (contentElement.getValue() instanceof SubjectConfirmationType) {
                SubjectConfirmationType confirmation = (SubjectConfirmationType) contentElement.getValue();
                if (confirmation.getMethod().equals(SamlConstants.CONFIRMATION_METHOD_BEARER)) {
                    SubjectConfirmationDataType confirmationData = confirmation.getSubjectConfirmationData();

                    boolean validRecipient = confirmationData.getRecipient().equals(samlEntityBean.get().getServiceURL(SamlServiceType.SAML_ASSERTION_CONSUMER_SERVICE));

                    boolean notTooLate = confirmationData.getNotOnOrAfter().compare(SamlUtils.getXMLGregorianCalendarNow()) == DatatypeConstants.GREATER;
View Full Code Here

        fillStatusResponseFields(response, SamlConstants.STATUS_SUCCESS, null);

        AssertionType assertion = assertionObjectFactory.createAssertionType();
        response.getAssertionOrEncryptedAssertion().add(assertion);

        SubjectType subject = assertionObjectFactory.createSubjectType();
        assertion.setSubject(subject);

        NameIDType nameID = assertionObjectFactory.createNameIDType();
        subject.getContent().add(assertionObjectFactory.createNameID(nameID));
        nameID.setValue(session.getPrincipal().getNameId().getValue());
        nameID.setFormat(session.getPrincipal().getNameId().getFormat());
        nameID.setNameQualifier(session.getPrincipal().getNameId().getQualifier());

        SubjectConfirmationType subjectConfirmation = assertionObjectFactory.createSubjectConfirmationType();
        subject.getContent().add(assertionObjectFactory.createSubjectConfirmation(subjectConfirmation));
        subjectConfirmation.setMethod(SamlConstants.CONFIRMATION_METHOD_BEARER);
        subjectConfirmation.setNameID(nameID);

        SubjectConfirmationDataType subjectConfirmationData = assertionObjectFactory.createSubjectConfirmationDataType();
        subjectConfirmation.setSubjectConfirmationData(subjectConfirmationData);
View Full Code Here

    protected void readEntitiesDescriptor(Reader reader) {
        try {
            Unmarshaller unmarshaller = metaDataJaxbContext.createUnmarshaller();
            JAXBElement<?> o = (JAXBElement<?>) unmarshaller.unmarshal(reader);
            EntitiesDescriptorType entitiesDescriptor = (EntitiesDescriptorType) o.getValue();
            readEntitiesDescriptor(entitiesDescriptor);
        } catch (JAXBException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

        for (Object object : entitiesDescriptor.getEntityDescriptorOrEntitiesDescriptor()) {
            if (object instanceof EntityDescriptorType) {
                EntityDescriptorType entityDescriptor = (EntityDescriptorType) object;
                readEntityDescriptor(entityDescriptor);
            } else {
                EntitiesDescriptorType descriptor = (EntitiesDescriptorType) object;
                readEntitiesDescriptor(descriptor);
            }
        }
    }
View Full Code Here

   {
      try
      {
         Unmarshaller unmarshaller = metaDataJaxbContext.createUnmarshaller();
         JAXBElement<?> o = (JAXBElement<?>) unmarshaller.unmarshal(reader);
         EntitiesDescriptorType entitiesDescriptor = (EntitiesDescriptorType) o.getValue();
         readEntitiesDescriptor(entitiesDescriptor);
      }
      catch (JAXBException e)
      {
         throw new RuntimeException(e);
View Full Code Here

            EntityDescriptorType entityDescriptor = (EntityDescriptorType) object;
            readEntityDescriptor(entityDescriptor);
         }
         else
         {
            EntitiesDescriptorType descriptor = (EntitiesDescriptorType) object;
            readEntitiesDescriptor(descriptor);
         }
      }
   }
View Full Code Here

    }

    private void readEntitiesDescriptor(EntitiesDescriptorType entitiesDescriptor) {
        for (Object object : entitiesDescriptor.getEntityDescriptorOrEntitiesDescriptor()) {
            if (object instanceof EntityDescriptorType) {
                EntityDescriptorType entityDescriptor = (EntityDescriptorType) object;
                readEntityDescriptor(entityDescriptor);
            } else {
                EntitiesDescriptorType descriptor = (EntitiesDescriptorType) object;
                readEntitiesDescriptor(descriptor);
            }
View Full Code Here

    protected EntityDescriptorType readEntityDescriptor(Reader metaInfoReader) {
        try {
            Unmarshaller unmarshaller = metaDataJaxbContext.createUnmarshaller();
            JAXBElement<?> o = (JAXBElement<?>) unmarshaller.unmarshal(metaInfoReader);
            EntityDescriptorType entityDescriptor = (EntityDescriptorType) o.getValue();
            return entityDescriptor;
        } catch (JAXBException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

        identityProviders.add(samlIdentityProvider);
        return samlIdentityProvider;
    }

    public SamlExternalIdentityProvider addExternalSamlEntity(Reader reader) {
        EntityDescriptorType entityDescriptor = readEntityDescriptor(reader);
        String entityId = entityDescriptor.getEntityID();
        IDPSSODescriptorType IDPSSODescriptor = (IDPSSODescriptorType) entityDescriptor.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor().get(0);
        return addExternalIdentityProvider(entityId, IDPSSODescriptor);
    }
View Full Code Here

TOP

Related Classes of org.jboss.seam.security.external.jaxb.samlv2.protocol.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.