final Issuer issuer = assertion.getIssuer(); if (issuer == null || issuer.getValue() == null) { throw new SamlException("failed to get an Issuer element from the assertion");
private String getIssuer(SamlAssertionWrapper assertionW) { Issuer samlIssuer = assertionW.getSaml2().getIssuer(); return samlIssuer == null ? null : samlIssuer.getValue(); }
/** * Method getIssuerString returns the issuerString of this SamlAssertionWrapper object. * * @return the issuerString (type String) of this SamlAssertionWrapper object. */ public String getIssuerString() { if (samlVersion == SAMLVersion.VERSION_20 && ((org.opensaml.saml.saml2.core.Assertion)samlObject).getIssuer() != null) { return ((org.opensaml.saml.saml2.core.Assertion)samlObject).getIssuer().getValue(); } else if (samlVersion == SAMLVersion.VERSION_11 && ((org.opensaml.saml.saml1.core.Assertion)samlObject).getIssuer() != null) { return ((org.opensaml.saml.saml1.core.Assertion)samlObject).getIssuer(); } LOG.error( "SamlAssertionWrapper: unable to return Issuer string - no saml assertion " + "object or issuer is null" ); return null; }
private String getIssuer(SamlAssertionWrapper assertionW) { Issuer samlIssuer = assertionW.getSaml2().getIssuer(); return samlIssuer == null ? null : samlIssuer.getValue(); }
/** * Get the string value which will be tracked in the cache for purposes of one-time use detection. * * @param assertion the SAML 2 Assertion to evaluate * * @return the cache value * * @throws AssertionValidationException thrown if there is a problem calculating the cached value */ @Nonnull protected String getCacheValue(@Nonnull final Assertion assertion) throws AssertionValidationException { String issuer = null; if (assertion.getIssuer() != null && assertion.getIssuer().getValue() != null) { issuer = StringSupport.trimOrNull(assertion.getIssuer().getValue()); } if (issuer == null) { issuer = "NoIssuer"; } String id = StringSupport.trimOrNull(assertion.getID()); if (id == null) { id = "NoID"; } String value = String.format("%s--%s", issuer, id); log.debug("Generated one-time use cache value of: {}", value); return value; }
c.setIssuer(assertion.getIssuer().getNameQualifier()); for (XMLObject attributeValue : attribute.getAttributeValues()) { Element attributeValueElement = attributeValue.getDOM();
c.setIssuer(assertion.getIssuer().getNameQualifier()); for (XMLObject attributeValue : attribute.getAttributeValues()) { Element attributeValueElement = attributeValue.getDOM();
c.setClaimType(URI.create(attribute.getName())); c.setIssuer(assertion.getIssuer().getNameQualifier());
logoutHandler.recordSession(context.getWebContext(), sessionIndex); final String issuerEntityId = subjectAssertion.getIssuer().getValue(); final List<AuthnStatement> authnStatements = subjectAssertion.getAuthnStatements(); final List<String> authnContexts = new ArrayList<>();
for (org.opensaml.saml.saml2.core.Assertion assertion : samlResponse.getAssertions()) { if (assertion.getIssuer() == null) { LOG.fine("Assertion Issuer must not be null"); throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity"); validateIssuer(assertion.getIssuer());
String idPEntityIdValue = assertion.getIssuer().getValue(); if ((idPEntityIdValue == null) || (idPEntityIdValue.isEmpty())) { throw new SSOException("SAML 2.0 Response does not contain an Issuer value");
final Issuer issuer = assertion.getIssuer(); if (issuer == null || issuer.getValue() == null) { throw new SamlException("failed to get an Issuer element from the assertion");
/** * Validate the given assertion: * - issueInstant * - issuer * - subject * - conditions * - authnStatements * - signature * * @param assertion the assertion * @param context the context * @param engine the engine * @param decrypter the decrypter */ protected final void validateAssertion(final Assertion assertion, final SAML2MessageContext context, final SignatureTrustEngine engine, final Decrypter decrypter) { validateIssueInstant(assertion.getIssueInstant()); validateIssuer(assertion.getIssuer(), context); if (assertion.getSubject() != null) { validateSubject(assertion.getSubject(), context, decrypter); } else { throw new SAMAssertionSubjectException("Assertion subject cannot be null"); } validateAssertionConditions(assertion.getConditions(), context); validateAuthenticationStatements(assertion.getAuthnStatements(), context); validateAssertionSignature(assertion.getSignature(), context, engine); }
protected Assertion resolveAssertion( org.opensaml.saml.saml2.core.Assertion parsed, List<SimpleKey> verificationKeys, List<SimpleKey> localKeys ) { Signature signature = validateSignature(parsed, verificationKeys); return new Assertion() .setSignature(signature) .setId(parsed.getID()) .setIssueInstant(parsed.getIssueInstant()) .setVersion(parsed.getVersion().toString()) .setIssuer(getIssuer(parsed.getIssuer())) .setSubject(getSubject(parsed.getSubject(), localKeys)) .setConditions(getConditions(parsed.getConditions())) .setAuthenticationStatements(getAuthenticationStatements(parsed.getAuthnStatements())) .setAttributes(getAttributes(parsed.getAttributeStatements(), localKeys)) ; }