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


Java AbstractSaml20ObjectBuilder类代码示例

本文整理汇总了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);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:35,代码来源:GoogleAccountsService.java

示例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);
}
 
开发者ID:xuchengdong,项目名称:cas4.1.9,代码行数:34,代码来源:GoogleAccountsService.java

示例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


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