Package org.openxri.saml

Examples of org.openxri.saml.Assertion


        || (!xrd.getQuery().equals(sSubsegment))) {
      return false;
    }

    // Must contain a SAML assertion
    Assertion oAssertion = xrd.getSAMLAssertion();
    if (oAssertion == null) {
      return false;
    }

    // Assertion must also be valid
    if (!oAssertion.isValid()) {
      return false;
    }

    // Subject must have correct info
    Subject oSubject = oAssertion.getSubject();
    if (oSubject == null) {
      return false;
    }

    NameID oNameID = oSubject.getNameID();
    if (oNameID == null) {
      return false;
    }

    if (!sSubsegment.equals(oNameID.getValue())) {
      return false;
    }

    if (!sAuthorityID.equals(oNameID.getNameQualifier())) {
      return false;
    }

    // must contain a SAML Attribute statement
    AttributeStatement oAttrStmt = oAssertion.getAttributeStatement();
    if (oAttrStmt == null) {
      return false;
    }

    // Attribute must describe the XML ID reference
View Full Code Here


    if ((bSigned) && (moConfig.getPrivateKey()!= null)) {

      try {

        Assertion oAssertion = createAssertion(
            xrd.getXmlID(),
            parent.getAuthorityId(),
            subSegment.getName());
        xrd.setSAMLAssertion(oAssertion);
        xrd.sign(moConfig.getPrivateKey());
View Full Code Here

    // create the conditions
    Conditions oConditions = new Conditions();

    // now we can create the true SAML Assertion
    Assertion oXRIAssertion = new Assertion();
    oXRIAssertion.setIssueInstant(DOMUtils.toXMLDateTime(new Date()));
    NameID oIssuer = new NameID(Tags.TAG_ISSUER);
    oIssuer.setValue(moConfig.getSAMLIssuer());
    oXRIAssertion.setIssuer(oIssuer);
    oXRIAssertion.setSubject(oSubject);
    oXRIAssertion.setAttrStatement(oAttrStatement);
    oXRIAssertion.setConditions(oConditions);

    if (soLog.isDebugEnabled()) soLog.debug("Done.");
    return oXRIAssertion;

  } // createAssertion()
View Full Code Here

    if ((bSigned) && (moConfig.getPrivateKey()!= null)) {

      try {

        Assertion oAssertion = createAssertion(
            xrd.getXmlID(),
            parent.getAuthorityId(),
            subSegment.getName());
        xrd.setSAMLAssertion(oAssertion);
        xrd.sign(moConfig.getPrivateKey());
View Full Code Here

    // create the conditions
    Conditions oConditions = new Conditions();

    // now we can create the true SAML Assertion
    Assertion oXRIAssertion = new Assertion();
    oXRIAssertion.setIssueInstant(DOMUtils.toXMLDateTime(new Date()));
    NameID oIssuer = new NameID(Tags.TAG_ISSUER);
    oIssuer.setValue(moConfig.getSAMLIssuer());
    oXRIAssertion.setIssuer(oIssuer);
    oXRIAssertion.setSubject(oSubject);
    oXRIAssertion.setAttrStatement(oAttrStatement);
    oXRIAssertion.setConditions(oConditions);

    if (soLog.isDebugEnabled()) soLog.debug("Done.");
    return oXRIAssertion;

  } // createAssertion()
View Full Code Here

          (oChild.getNamespaceURI() != null) &&
          oChild.getNamespaceURI().equals(Tags.NS_SAML) &&
          (oChild.getLocalName() != null) &&
          oChild.getLocalName().equals(Tags.TAG_ASSERTION))
      {
        samlAssertion = new Assertion(oChild);
      }
      // Added this code to support extensions in Authority Element
      else
      {
        Vector oVector =
View Full Code Here

        || (!xrd.getQuery().equals(sSubsegment))) {
      return false;
    }

    // Must contain a SAML assertion
    Assertion oAssertion = xrd.getSAMLAssertion();
    if (oAssertion == null) {
      return false;
    }

    // Assertion must also be valid
    if (!oAssertion.isValid()) {
      return false;
    }

    // Subject must have correct info
    Subject oSubject = oAssertion.getSubject();
    if (oSubject == null) {
      return false;
    }

    NameID oNameID = oSubject.getNameID();
    if (oNameID == null) {
      return false;
    }

    if (!sSubsegment.equals(oNameID.getValue())) {
      return false;
    }

    if (!sAuthorityID.equals(oNameID.getNameQualifier())) {
      return false;
    }

    // must contain a SAML Attribute statement
    AttributeStatement oAttrStmt = oAssertion.getAttributeStatement();
    if (oAttrStmt == null) {
      return false;
    }

    // Attribute must describe the XML ID reference
View Full Code Here

          (oChild.getNamespaceURI() != null) &&
          oChild.getNamespaceURI().equals(Tags.NS_SAML) &&
          (oChild.getLocalName() != null) &&
          oChild.getLocalName().equals(Tags.TAG_ASSERTION))
      {
        moSAMLAssertion = new Assertion((Element) oChild);
      }
     
      // Added this code to support extensions in Authority Element
      else
      {
View Full Code Here

            oAttr.setValue("#" + oXRID.getXmlID());
            oAttr.setName(Tags.TAG_XRD);
            oAttrStatement.setAttribute(oAttr);

            // now we can create the true SAML Assertion
            Assertion oAssertion = new Assertion();
            NameID oIssuer = new NameID(Tags.TAG_ISSUER);
            oIssuer.setValue("World's Best");
            oAssertion.setIssuer(oIssuer);
            oAssertion.setSubject(oSubject);
            oAssertion.setAttrStatement(oAttrStatement);
            oXRID.setSAMLAssertion(oAssertion);

            oXRID.sign(oKP.getPrivate());
            oXRID.setDOM(oXRID.getDOM());
            oXRID.verifySignature(oKP.getPublic());
View Full Code Here

          (oChild.getNamespaceURI() != null) &&
          oChild.getNamespaceURI().equals(Tags.NS_SAML) &&
          (oChild.getLocalName() != null) &&
          oChild.getLocalName().equals(Tags.TAG_ASSERTION))
      {
        moSAMLAssertion = new Assertion((Element) oChild);
      }
     
      // Added this code to support extensions in Authority Element
      else
      {
View Full Code Here

TOP

Related Classes of org.openxri.saml.Assertion

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.