org.opensaml.saml.saml2.core.Assertion.getIssuer()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(193)

本文整理了Java中org.opensaml.saml.saml2.core.Assertion.getIssuer()方法的一些代码示例,展示了Assertion.getIssuer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assertion.getIssuer()方法的具体详情如下:
包路径:org.opensaml.saml.saml2.core.Assertion
类名称:Assertion
方法名:getIssuer

Assertion.getIssuer介绍

[英]Gets the Issuer of this assertion.
[中]获取此断言的颁发者。

代码示例

代码示例来源:origin: line/armeria

final Issuer issuer = assertion.getIssuer();
if (issuer == null || issuer.getValue() == null) {
  throw new SamlException("failed to get an Issuer element from the assertion");

代码示例来源:origin: apache/cxf

private String getIssuer(SamlAssertionWrapper assertionW) {
  Issuer samlIssuer = assertionW.getSaml2().getIssuer();
  return samlIssuer == null ? null : samlIssuer.getValue();
}

代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-common

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

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-security-oauth2-saml

private String getIssuer(SamlAssertionWrapper assertionW) {
  Issuer samlIssuer = assertionW.getSaml2().getIssuer();
  return samlIssuer == null ? null : samlIssuer.getValue();
}

代码示例来源:origin: org.opensaml/opensaml-saml-impl

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

代码示例来源:origin: apache/cxf

c.setIssuer(assertion.getIssuer().getNameQualifier());
for (XMLObject attributeValue : attribute.getAttributeValues()) {
  Element attributeValueElement = attributeValue.getDOM();

代码示例来源:origin: org.apache.cxf.services.sts/cxf-services-sts-core

c.setIssuer(assertion.getIssuer().getNameQualifier());
for (XMLObject attributeValue : attribute.getAttributeValues()) {
  Element attributeValueElement = attributeValue.getDOM();

代码示例来源:origin: org.apache.cxf.fediz/fediz-idp-core

c.setClaimType(URI.create(attribute.getName()));
c.setIssuer(assertion.getIssuer().getNameQualifier());

代码示例来源:origin: org.opensaml/opensaml-saml-api

if (token.getIssuer() != null) {
  issuer = StringSupport.trimOrNull(token.getIssuer().getValue());

代码示例来源:origin: org.opensaml/opensaml-saml-api

if (token.getIssuer() != null) {
  tokenIssuer = token.getIssuer().getValue();

代码示例来源:origin: org.opensaml/opensaml-saml-impl

if (input.getAssertion().getIssuer() != null) {
  issuer = StringSupport.trimOrNull(input.getAssertion().getIssuer().getValue());

代码示例来源:origin: org.pac4j/pac4j-saml

logoutHandler.recordSession(context.getWebContext(), sessionIndex);
final String issuerEntityId = subjectAssertion.getIssuer().getValue();
final List<AuthnStatement> authnStatements = subjectAssertion.getAuthnStatements();
final List<String> authnContexts = new ArrayList<>();

代码示例来源:origin: apache/cxf

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());

代码示例来源:origin: org.wso2.appserver/appserver-webapp-security

String idPEntityIdValue = assertion.getIssuer().getValue();
if ((idPEntityIdValue == null) || (idPEntityIdValue.isEmpty())) {
  throw new SSOException("SAML 2.0 Response does not contain an Issuer value");

代码示例来源:origin: com.linecorp.armeria/armeria-saml

final Issuer issuer = assertion.getIssuer();
if (issuer == null || issuer.getValue() == null) {
  throw new SamlException("failed to get an Issuer element from the assertion");

代码示例来源:origin: org.pac4j/pac4j-saml

/**
 * 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);
}

代码示例来源:origin: spring-projects/spring-security-saml

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))
    ;
}

相关文章