Package org.jboss.identity.federation.saml.v2.profiles.xacml.assertion

Examples of org.jboss.identity.federation.saml.v2.profiles.xacml.assertion.ObjectFactory


    * @param value a {@code String} representing the name value.
    * @return the constructed {@code NameIDType} instance.
    */
   public static NameIDType createNameID(String format, String qualifier, String value)
   {
      NameIDType nameID = new NameIDType();
      nameID.setFormat(format);
      nameID.setNameQualifier(qualifier);
      nameID.setValue(value);
      return nameID;
   }
View Full Code Here


   public static Element toElement(AssertionType assertion) throws Exception
   {
      Document document = DocumentUtil.createDocument();
      DOMResult result = new DOMResult(document);
      Marshaller marshaller = JAXBUtil.getMarshaller("org.jboss.identity.federation.saml.v2.assertion");
      marshaller.marshal(new ObjectFactory().createAssertion(assertion), result);

      // normalize the document to remove unused namespaces.
      DOMConfiguration docConfig = document.getDomConfig();
      docConfig.setParameter("namespaces", Boolean.TRUE);
      docConfig.setParameter("namespace-declarations", Boolean.FALSE);
View Full Code Here

    * @return
    */
   public static AttributeType createAttribute(String name, String nameFormat,
         Object... attributeValues)
   {
      ObjectFactory of = SAMLAssertionFactory.getObjectFactory();
      AttributeType att = of.createAttributeType();
      att.setName(name);
      att.setNameFormat(nameFormat);
      if(attributeValues != null && attributeValues.length > 0)
      {
         for(Object attributeValue:attributeValues)
         {
            att.getAttributeValue().add(of.createAttributeValue(attributeValue));
         }
      }
      return att;
   }
View Full Code Here

  
   public IssuerInfoHolder(String issuerAsString)
   {
      if(issuerAsString == null)
         throw new IllegalArgumentException("issuerAsString is null");
      ObjectFactory assertionObjectFactory = new ObjectFactory();
      issuer = assertionObjectFactory.createNameIDType();
      issuer.setValue(issuerAsString);
   }
View Full Code Here

    * @return the constructed {@code SubjectType} instance.
    */
   public static SubjectType createSubject(NameIDType nameID, SubjectConfirmationType confirmation)
   {
      SubjectType subject = new SubjectType();
      ObjectFactory factory = getObjectFactory();
      if (nameID != null)
         subject.getContent().add(factory.createNameID(nameID));
      if (confirmation != null)
         subject.getContent().add(factory.createSubjectConfirmation(confirmation));
      return subject;
   }
View Full Code Here

    * @return
    */
   public static SubjectConfirmationDataType createSubjectConfirmationData(String inResponseTo,
         String destinationURI, XMLGregorianCalendar issueInstant)
   {
      SubjectConfirmationDataType subjectConfirmationData = assertionObjectFactory.createSubjectConfirmationDataType();
      subjectConfirmationData.setInResponseTo(inResponseTo);
      subjectConfirmationData.setRecipient(destinationURI);
      subjectConfirmationData.setNotBefore(issueInstant);
      subjectConfirmationData.setNotOnOrAfter(issueInstant);
     
      return subjectConfirmationData;
   }
View Full Code Here

      JAXBElement<NameIDType> jaxbNameIDType = JBossSAMLBaseFactory.createNameID(nameIDType);
      subjectType.getContent().add(jaxbNameIDType);
     
      SubjectConfirmationType subjectConfirmation =
            JBossSAMLBaseFactory.createSubjectConfirmation(idp.getSubjectConfirmationMethod());
      SubjectConfirmationDataType subjectConfirmationData =
           JBossSAMLBaseFactory.createSubjectConfirmationData(sp.getRequestID(),
                 responseDestinationURI, issueInstant);
      subjectConfirmation.setSubjectConfirmationData(subjectConfirmationData);
     
      JAXBElement<SubjectConfirmationType> jaxbSubjectConfirmationType =
View Full Code Here

      ConditionsType conditions = SAMLAssertionFactory.createConditions(lifetime.getCreated(), lifetime.getExpires(),
            restriction);

      // TODO: implement support for the other confirmation methods.
      String confirmationMethod = SAMLUtil.SAML2_BEARER_URI;
      SubjectConfirmationType subjectConfirmation = SAMLAssertionFactory.createSubjectConfirmation(null,
            confirmationMethod, null);

      // create a subject using the caller principal.
      Principal principal = context.getCallerPrincipal();
      String subjectName = principal == null ? "ANONYMOUS" : principal.getName();
View Full Code Here

    * @param method
    * @return
    */
   public static SubjectConfirmationType createSubjectConfirmation(String method)
   {
      SubjectConfirmationType sct = assertionObjectFactory.createSubjectConfirmationType();
      sct.setMethod(method);
      return sct;
   }
View Full Code Here

      nameIDType.setValue(idp.getNameIDFormatValue());
     
      JAXBElement<NameIDType> jaxbNameIDType = JBossSAMLBaseFactory.createNameID(nameIDType);
      subjectType.getContent().add(jaxbNameIDType);
     
      SubjectConfirmationType subjectConfirmation =
            JBossSAMLBaseFactory.createSubjectConfirmation(idp.getSubjectConfirmationMethod());
      SubjectConfirmationDataType subjectConfirmationData =
           JBossSAMLBaseFactory.createSubjectConfirmationData(sp.getRequestID(),
                 responseDestinationURI, issueInstant);
      subjectConfirmation.setSubjectConfirmationData(subjectConfirmationData);
     
      JAXBElement<SubjectConfirmationType> jaxbSubjectConfirmationType =
         JBossSAMLBaseFactory.createSubjectConfirmation(subjectConfirmation);
     
      subjectType.getContent().add(jaxbSubjectConfirmationType);
View Full Code Here

TOP

Related Classes of org.jboss.identity.federation.saml.v2.profiles.xacml.assertion.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.