当前位置: 首页>>代码示例>>Java>>正文


Java Issuer.getValue方法代码示例

本文整理汇总了Java中org.opensaml.saml2.core.Issuer.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Issuer.getValue方法的具体用法?Java Issuer.getValue怎么用?Java Issuer.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opensaml.saml2.core.Issuer的用法示例。


在下文中一共展示了Issuer.getValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOriginatingIdpEntityId

import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
 * Get the id of the issuing entity.
 * @param handler Handler which holds sent request ids. This is used if the response has a InResponseTo.
 * 
 * @throws ValidationException If the response is unsolicited and does not contain an issuer.
 */
public String getOriginatingIdpEntityId(SessionHandler handler) {
	if (response.getInResponseTo() == null) {
		Issuer issuer = null;
		if (!response.getAssertions().isEmpty()) {
			issuer = response.getAssertions().get(0).getIssuer();
		}
		if (issuer == null) {
			issuer = response.getIssuer();
		}
		
		if (issuer == null)  {
			throw new ValidationException("SAML Response does not contain a issuer, this is required for unsolicited Responses");
		}
		return issuer.getValue();
	} else {
		return handler.removeEntityIdForRequest(response.getInResponseTo());
	}
}
 
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:25,代码来源:OIOResponse.java

示例2: setAssertion

import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
public synchronized void setAssertion(String sessionId, OIOAssertion assertion) throws IllegalArgumentException{
	Issuer issuer = assertion.getAssertion().getIssuer();
	String key = (issuer != null ? issuer.getValue() : "unknown") + ":" + assertion.getAssertion().getID();
	if(usedAssertionIds.containsKey(key)) {
		throw new IllegalArgumentException("Assertion ID begin replayed: " + key);
	}
	usedAssertionIds.put(key, assertion.getAssertion().getID());
	sessionMap.put(sessionId, new TimeOutWrapper<OIOAssertion>(assertion));

	String sessionIndex = assertion.getSessionIndex();
	if (sessionIndex != null) {
		// Remove the old sessionIndex
		sessionIndexMap.remove(sessionIndex);

		// Store the new sessionIndex
		sessionIndexMap.put(sessionIndex, new TimeOutWrapper<String>(sessionId));
	}
}
 
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:19,代码来源:SingleVMSessionHandler.java

示例3: extractEntityId

import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
 * Extracts the entity ID from the SAML 2 Issuer.
 * 
 * @param issuer issuer to extract the entityID from
 * 
 * @return entity ID of the issuer
 * 
 * @throws MessageDecodingException thrown if the given issuer has a format other than {@link NameIDType#ENTITY}
 */
protected String extractEntityId(Issuer issuer) throws MessageDecodingException {
    if (issuer != null) {
        if (issuer.getFormat() == null || issuer.getFormat().equals(NameIDType.ENTITY)) {
            return issuer.getValue();
        } else {
            throw new MessageDecodingException("SAML 2 Issuer is not of ENTITY format type");
        }
    }

    return null;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:BaseSAML2MessageDecoder.java

示例4: testSingleElementUnmarshall

import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementUnmarshall() {
    Issuer issuer = (Issuer) unmarshallElement(singleElementFile);

    String issuername = issuer.getValue();
    assertEquals("Issuer was " + issuername + ", expected " + expectedIssuer, expectedIssuer, issuername);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:8,代码来源:IssuerTest.java

示例5: findSaml20IdpConnectorToUse

import org.opensaml.saml2.core.Issuer; //导入方法依赖的package包/类
/**
 * Find the SAML 2.0 IdP Connector to use to process the SAML Object.
 * 
 * @param samlObject
 *            the SAML 2.0 object to process
 * @return the SAML 2.0 IdP connector attached
 * @throws SamlProcessingException
 *             if no IdP connector found
 */
protected ISaml20IdpConnector findSaml20IdpConnectorToUse(final SAMLObject samlObject)
		throws SamlProcessingException {
	ISaml20IdpConnector samlConnector = null;

	Assert.notNull(samlObject, "No signable SAML objet provided !");

	if (StatusResponseType.class.isAssignableFrom(samlObject.getClass())) {
		// The SAML object is a Response, so the original request must be in the cache !
		final StatusResponseType samlResponse = (StatusResponseType) samlObject;
		final String originalRequestId = samlResponse.getInResponseTo();

		if (StringUtils.hasText(originalRequestId)) {
			final IRequestWaitingForResponse originalRequestData = this.saml20Storage.findRequestWaitingForResponse(originalRequestId);
			if (originalRequestData != null) {
				samlConnector = originalRequestData.getIdpConnectorBuilder();
			}
		}

	} else if (RequestAbstractType.class.isAssignableFrom(samlObject.getClass())) {
		// Search IdPConnector by Issuer
		final RequestAbstractType samlRequest = (RequestAbstractType) samlObject;

		final Issuer issuer = samlRequest.getIssuer();
		if (issuer != null) {
			final String issuerEntityId = issuer.getValue();
			samlConnector = this.idpConnectorsByEntityId.get(issuerEntityId);
		}

	}

	if (samlConnector == null) {
		throw new SamlProcessingException("Unable to find an IdP Connector to process the SAML request !");
	}

	return samlConnector;
}
 
开发者ID:mxbossard,项目名称:java-saml2-sp,代码行数:46,代码来源:OpenSaml20SpProcessor.java


注:本文中的org.opensaml.saml2.core.Issuer.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。