本文整理汇总了Java中uk.gov.ida.saml.deserializers.parser.SamlObjectParser类的典型用法代码示例。如果您正苦于以下问题:Java SamlObjectParser类的具体用法?Java SamlObjectParser怎么用?Java SamlObjectParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SamlObjectParser类属于uk.gov.ida.saml.deserializers.parser包,在下文中一共展示了SamlObjectParser类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertStatusCode
import uk.gov.ida.saml.deserializers.parser.SamlObjectParser; //导入依赖的package包/类
private static void assertStatusCode(String samlString, String statusCode) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException, org.opensaml.core.xml.io.UnmarshallingException {
final SamlObjectParser samlObjectParser = new SamlObjectParser();
final Base64StringDecoder base64Decoder = new Base64StringDecoder();
String decodedString = base64Decoder.decode(samlString);
org.opensaml.saml.saml2.core.Response samlResponse = samlObjectParser.getSamlObject(decodedString);
assertThat(samlResponse.getStatus().getStatusCode().getValue()).isEqualTo(statusCode);
}
示例2: makeAttributeQueryRequest
import uk.gov.ida.saml.deserializers.parser.SamlObjectParser; //导入依赖的package包/类
public static Response makeAttributeQueryRequest(String uri, AttributeQuery attributeQuery, SignatureAlgorithm signatureAlgorithm, DigestAlgorithm digestAlgorithm, String hubEntityId) {
ElementToOpenSamlXMLObjectTransformer<Response> responseElementToOpenSamlXMLObjectTransformer = new ElementToOpenSamlXMLObjectTransformer<>(new SamlObjectParser());
Document attributeQueryDocument = getAttributeQueryToElementTransformer(signatureAlgorithm, digestAlgorithm, hubEntityId).apply(attributeQuery).getOwnerDocument();
Document soapResponse = JerseyClientBuilder.createClient().target(uri).request()
.post(Entity.entity(attributeQueryDocument, TEXT_XML_TYPE))
.readEntity(Document.class);
Element soapMessage = new SoapMessageManager().unwrapSoapMessage(soapResponse, SamlElementType.Response);
return responseElementToOpenSamlXMLObjectTransformer.apply(soapMessage);
}
示例3: buildResponseFromFile
import uk.gov.ida.saml.deserializers.parser.SamlObjectParser; //导入依赖的package包/类
private SAMLObject buildResponseFromFile() throws IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, org.opensaml.core.xml.io.UnmarshallingException {
String xmlString = new String(Files.readAllBytes(Paths.get(ResourceHelpers.resourceFilePath("EIDASAMLResponse.xml"))));
return (Response) new SamlObjectParser().getSamlObject(xmlString);
}