本文整理汇总了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);
}
示例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);
}
}
示例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;
}
示例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));
}
示例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);
}