本文整理汇总了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());
}
}
示例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));
}
}
示例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;
}
示例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);
}
示例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;
}