Package org.jboss.identity.federation.saml.v2.metadata

Examples of org.jboss.identity.federation.saml.v2.metadata.ObjectFactory


   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
    */
   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

      //Check for validity of assertion
      boolean expiredAssertion = AssertionUtil.hasExpired(assertion);
      if(expiredAssertion)
         throw new AssertionExpiredException();
     
      SubjectType subject = assertion.getSubject();
      JAXBElement<NameIDType> jnameID = (JAXBElement<NameIDType>) subject.getContent().get(0);
      NameIDType nameID = jnameID.getValue();
      String userName = nameID.getValue();
      List<String> roles = new ArrayList<String>();

      //Let us get the roles
View Full Code Here

      //Check for validity of assertion
      boolean expiredAssertion = AssertionUtil.hasExpired(assertion);
      if(expiredAssertion)
         throw new AssertionExpiredException();
     
      SubjectType subject = assertion.getSubject();
      JAXBElement<NameIDType> jnameID = (JAXBElement<NameIDType>) subject.getContent().get(0);
      NameIDType nameID = jnameID.getValue();
      final String userName = nameID.getValue();
      List<String> roles = new ArrayList<String>();

      //Let us get the roles
View Full Code Here

TOP

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