本文整理汇总了Java中org.opensaml.saml2.core.ArtifactResponse.setMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ArtifactResponse.setMessage方法的具体用法?Java ArtifactResponse.setMessage怎么用?Java ArtifactResponse.setMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opensaml.saml2.core.ArtifactResponse
的用法示例。
在下文中一共展示了ArtifactResponse.setMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processChildElement
import org.opensaml.saml2.core.ArtifactResponse; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
throws UnmarshallingException {
ArtifactResponse artifactResponse = (ArtifactResponse) parentSAMLObject;
if (childSAMLObject instanceof Issuer) {
artifactResponse.setIssuer((Issuer) childSAMLObject);
} else if (childSAMLObject instanceof Signature) {
artifactResponse.setSignature((Signature) childSAMLObject);
} else if (childSAMLObject instanceof Extensions) {
artifactResponse.setExtensions((Extensions) childSAMLObject);
} else if (childSAMLObject instanceof Status) {
artifactResponse.setStatus((Status) childSAMLObject);
} else {
artifactResponse.setMessage((SAMLObject) childSAMLObject);
}
}
示例2: buildArtifactResponse
import org.opensaml.saml2.core.ArtifactResponse; //导入方法依赖的package包/类
private ArtifactResponse buildArtifactResponse() throws IllegalAccessException, NoSuchAlgorithmException, KeyStoreException,
java.security.cert.CertificateException, CertificateException, IOException, SecurityException, EncryptionException, NoSuchProviderException,
SignatureException, MarshallingException, MetadataProviderException {
SecureRandomIdentifierGenerator idGenerator = new SecureRandomIdentifierGenerator();
ArtifactResponse artifactResponse = buildXMLObjectDefaultName(ArtifactResponse.class);
Issuer issuer = buildXMLObjectDefaultName(Issuer.class);
issuer.setValue(MockIDPProperties.getIdpEntityId());
artifactResponse.setIssuer(issuer);
artifactResponse.setIssueInstant(new DateTime());
artifactResponse.setDestination(MockIDPSPMetadata.getSpConsumerUrl());
artifactResponse.setID(idGenerator.generateIdentifier());
Status status = buildXMLObjectDefaultName(Status.class);
StatusCode statusCode = buildXMLObjectDefaultName(StatusCode.class);
statusCode.setValue(StatusCode.SUCCESS_URI);
status.setStatusCode(statusCode);
artifactResponse.setStatus(status);
Response response = buildXMLObjectDefaultName(Response.class);
response.setDestination(MockIDPSPMetadata.getSpConsumerUrl());
response.setIssueInstant(new DateTime());
response.setID(idGenerator.generateIdentifier());
response.setInResponseTo(MockIDPAuthnReq.authnReqId);
Issuer issuer2 = buildXMLObjectDefaultName(Issuer.class);
issuer2.setValue(MockIDPProperties.getIdpEntityId());
response.setIssuer(issuer2);
Status status2 = buildXMLObjectDefaultName(Status.class);
StatusCode statusCode2 = buildXMLObjectDefaultName(StatusCode.class);
statusCode2.setValue(StatusCode.SUCCESS_URI);
status2.setStatusCode(statusCode2);
response.setStatus(status2);
artifactResponse.setMessage(response);
response.getEncryptedAssertions().add(encryptAssertion(buildAssertion()));
return artifactResponse;
}