當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。