本文整理汇总了Java中org.jasig.cas.support.saml.util.AbstractSaml20ObjectBuilder类的典型用法代码示例。如果您正苦于以下问题:Java AbstractSaml20ObjectBuilder类的具体用法?Java AbstractSaml20ObjectBuilder怎么用?Java AbstractSaml20ObjectBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractSaml20ObjectBuilder类属于org.jasig.cas.support.saml.util包,在下文中一共展示了AbstractSaml20ObjectBuilder类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createServiceFrom
import org.jasig.cas.support.saml.util.AbstractSaml20ObjectBuilder; //导入依赖的package包/类
/**
* Creates the service from request.
*
* @param request the request
* @param privateKey the private key
* @param publicKey the public key
* @param servicesManager the services manager
* @return the google accounts service
*/
public static GoogleAccountsService createServiceFrom(
final HttpServletRequest request, final PrivateKey privateKey,
final PublicKey publicKey, final ServicesManager servicesManager) {
final String relayState = request.getParameter(SamlProtocolConstants.PARAMETER_SAML_RELAY_STATE);
final String xmlRequest = BUILDER.decodeSamlAuthnRequest(
request.getParameter(SamlProtocolConstants.PARAMETER_SAML_REQUEST));
if (!StringUtils.hasText(xmlRequest)) {
return null;
}
final Document document = AbstractSaml20ObjectBuilder.constructDocumentFromXml(xmlRequest);
if (document == null) {
return null;
}
final Element root = document.getRootElement();
final String assertionConsumerServiceUrl = root.getAttributeValue("AssertionConsumerServiceURL");
final String requestId = root.getAttributeValue("ID");
return new GoogleAccountsService(assertionConsumerServiceUrl,
relayState, requestId, privateKey, publicKey, servicesManager);
}
示例2: createServiceFrom
import org.jasig.cas.support.saml.util.AbstractSaml20ObjectBuilder; //导入依赖的package包/类
/**
* Creates the service from request.
*
* @param request the request
* @param privateKey the private key
* @param publicKey the public key
* @return the google accounts service
*/
public static GoogleAccountsService createServiceFrom(
final HttpServletRequest request, final PrivateKey privateKey,
final PublicKey publicKey) {
final String relayState = request.getParameter(SamlProtocolConstants.PARAMETER_SAML_RELAY_STATE);
final String xmlRequest = BUILDER.decodeSamlAuthnRequest(
request.getParameter(SamlProtocolConstants.PARAMETER_SAML_REQUEST));
if (!StringUtils.hasText(xmlRequest)) {
return null;
}
final Document document = AbstractSaml20ObjectBuilder.constructDocumentFromXml(xmlRequest);
if (document == null) {
return null;
}
final Element root = document.getRootElement();
final String assertionConsumerServiceUrl = root.getAttributeValue("AssertionConsumerServiceURL");
final String requestId = root.getAttributeValue("ID");
return new GoogleAccountsService(assertionConsumerServiceUrl,
relayState, requestId, privateKey, publicKey);
}
示例3: ensureInflation
import org.jasig.cas.support.saml.util.AbstractSaml20ObjectBuilder; //导入依赖的package包/类
@Test
public void ensureInflation() throws Exception {
final String deflator = CompressionUtils.deflate(SAML_REQUEST);
final AbstractSaml20ObjectBuilder builder = new GoogleSaml20ObjectBuilder();
final String msg = builder.decodeSamlAuthnRequest(deflator);
assertEquals(msg, SAML_REQUEST);
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:8,代码来源:GoogleAppsSamlAuthenticationRequestTests.java