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


Java CommonUtils.constructServiceUrl方法代码示例

本文整理汇总了Java中org.jasig.cas.client.util.CommonUtils.constructServiceUrl方法的典型用法代码示例。如果您正苦于以下问题:Java CommonUtils.constructServiceUrl方法的具体用法?Java CommonUtils.constructServiceUrl怎么用?Java CommonUtils.constructServiceUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jasig.cas.client.util.CommonUtils的用法示例。


在下文中一共展示了CommonUtils.constructServiceUrl方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createServiceUrl

import org.jasig.cas.client.util.CommonUtils; //导入方法依赖的package包/类
@Override
protected String createServiceUrl(HttpServletRequest request, HttpServletResponse response) {
    String serviceUrl = buildUrl(request, loginPath).orElse(loginPath);
    return CommonUtils.constructServiceUrl(null, response, serviceUrl, null,
            getServiceProperties().getServiceParameter(), getServiceProperties().getArtifactParameter(), true);
}
 
开发者ID:kakawait,项目名称:cas-security-spring-boot-starter,代码行数:7,代码来源:RequestAwareCasAuthenticationEntryPoint.java

示例2: constructServiceUrl

import org.jasig.cas.client.util.CommonUtils; //导入方法依赖的package包/类
/**
 * Use the CAS CommonUtils to build the CAS Service URL.
 */
private String constructServiceUrl(final HttpServletRequest request, final HttpServletResponse response) {
    return CommonUtils.constructServiceUrl(request, response, null, serverName, artifactParameterName, true);
}
 
开发者ID:Unicon,项目名称:shib-cas-authn2,代码行数:7,代码来源:CasCallbackServlet.java

示例3: constructServiceUrl

import org.jasig.cas.client.util.CommonUtils; //导入方法依赖的package包/类
/**
 * Construct service url string.
 *
 * @param request  the request
 * @param response the response
 * @param pair     the pair
 * @return the string
 * @throws SamlException the saml exception
 */
protected String constructServiceUrl(final HttpServletRequest request,
                                     final HttpServletResponse response,
                                     final Pair<? extends SignableSAMLObject, MessageContext> pair) throws SamlException {
    final AuthnRequest authnRequest = AuthnRequest.class.cast(pair.getLeft());
    final MessageContext messageContext = pair.getRight();

    try (StringWriter writer = SamlUtils.transformSamlObject(this.configBean, authnRequest)) {
        final URLBuilder builder = new URLBuilder(this.callbackService.getId());
        builder.getQueryParams().add(
                new net.shibboleth.utilities.java.support.collection.Pair<>(SamlProtocolConstants.PARAMETER_ENTITY_ID,
                        SamlIdPUtils.getIssuerFromSamlRequest(authnRequest)));

        final String samlRequest = EncodingUtils.encodeBase64(writer.toString().getBytes(StandardCharsets.UTF_8));
        builder.getQueryParams().add(
                new net.shibboleth.utilities.java.support.collection.Pair<>(SamlProtocolConstants.PARAMETER_SAML_REQUEST,
                        samlRequest));
        builder.getQueryParams().add(
                new net.shibboleth.utilities.java.support.collection.Pair<>(SamlProtocolConstants.PARAMETER_SAML_RELAY_STATE,
                        SAMLBindingSupport.getRelayState(messageContext)));
        final String url = builder.buildURL();

        LOGGER.debug("Built service callback url [{}]", url);
        return CommonUtils.constructServiceUrl(request, response,
                url, this.serverName,
                CasProtocolConstants.PARAMETER_SERVICE,
                CasProtocolConstants.PARAMETER_TICKET, false);
    } catch (final Exception e) {
        throw new SamlException(e.getMessage(), e);
    }
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:40,代码来源:AbstractSamlProfileHandlerController.java

示例4: constructServiceUrl

import org.jasig.cas.client.util.CommonUtils; //导入方法依赖的package包/类
/**
 * Use the CAS CommonUtils to build the CAS Service URL.
 */
protected String constructServiceUrl(final HttpServletRequest request, final HttpServletResponse response) {
    String serviceUrl = CommonUtils.constructServiceUrl(request, response, null, serverName, serviceParameterName, artifactParameterName, true);

    if ("embed".equalsIgnoreCase(entityIdLocation)) {
        serviceUrl += (new EntityIdParameterBuilder().getParameterString(request, false));
    }

    return serviceUrl;
}
 
开发者ID:Unicon,项目名称:shib-cas-authn3,代码行数:13,代码来源:ShibcasAuthServlet.java

示例5: shibbolethSessionInitiate

import org.jasig.cas.client.util.CommonUtils; //导入方法依赖的package包/类
private void shibbolethSessionInitiate(HttpServletRequest request,	HttpServletResponse response) throws IOException {
	String serverURL = urlGenerator.getServerURL();

	// re-use code from CAS to reconstruct current URL
	// (nb: not using encode=true since it adds jsessionid in url which mess up things. we do not need it since we will have _shibsession_)
	String target = CommonUtils.constructServiceUrl(request, response, null, serverURL, "_shibsession_", false);
	
	String url = shibbolethSessionInitiatorUrl + "?target=" + UrlGenerator.urlencode(target);

	String idpId = request.getParameter("idpId");
	if (idpId != null) url += "&providerId=" + idpId;

	response.sendRedirect(concatUrlAndLocation(serverURL, url));
}
 
开发者ID:EsupPortail,项目名称:esup-smsu,代码行数:15,代码来源:AuthAndRoleAndMiscFilter.java

示例6: getUrlEncodedService

import org.jasig.cas.client.util.CommonUtils; //导入方法依赖的package包/类
protected final String getUrlEncodedService(final HttpServletResponse response) {
	ServiceProperties sp = wrappedCasAuthEntryPoint.getServiceProperties();
	return CommonUtils.constructServiceUrl(null, response, sp.getService(), null, sp.getArtifactParameter(), true);
}
 
开发者ID:SmarterApp,项目名称:TechnologyReadinessTool,代码行数:5,代码来源:CasAuthenticationEntryPoint.java


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