Examples of Assertion


Examples of org.opensaml.saml2.core.Assertion

    @Override
    public Credential validate(Credential credential, RequestData data) throws WSSecurityException {
        Credential validatedCredential = super.validate(credential, data);
        AssertionWrapper assertion = validatedCredential.getAssertion();
       
        Assertion saml2Assertion = assertion.getSaml2();
        if (saml2Assertion == null) {
            throw new WSSecurityException(WSSecurityException.FAILURE, "invalidSAMLsecurity");
        }
       
        List<AttributeStatement> attributeStatements = saml2Assertion.getAttributeStatements();
        if (attributeStatements == null || attributeStatements.isEmpty()) {
            throw new WSSecurityException(WSSecurityException.FAILURE, "invalidSAMLsecurity");
        }
       
        Subject subject = saml2Assertion.getSubject();
        NameID nameID = subject.getNameID();
        String subjectName = nameID.getValue();
        if ("alice".equals(subjectName) || "bob".equals(subjectName)) {
            return validatedCredential;
        }
View Full Code Here

Examples of org.opensaml.saml2.core.Assertion

                    "OpenSaml engine not initialized. Please make sure to initialize the OpenSaml engine "
                    + "prior using it"
                );
            }
        }
        Assertion assertion =
            assertionBuilder.buildObject(Assertion.DEFAULT_ELEMENT_NAME, Assertion.TYPE_NAME);
        assertion.setID("_" + UUIDGenerator.getUUID());
        assertion.setVersion(SAMLVersion.VERSION_20);
        assertion.setIssueInstant(new DateTime());
        return assertion;
    }
View Full Code Here

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

Examples of org.uispec4j.assertion.Assertion

    }
    return table;
  }

    public Assertion containsAttributeTable() {
        return new Assertion() {
          public void check() {
            Assert.assertTrue(findAttributeTable() != null);
          }
        };
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.