本文整理匯總了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