本文整理汇总了Java中org.jasig.cas.util.HttpClient类的典型用法代码示例。如果您正苦于以下问题:Java HttpClient类的具体用法?Java HttpClient怎么用?Java HttpClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HttpClient类属于org.jasig.cas.util包,在下文中一共展示了HttpClient类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LogoutManagerImpl
import org.jasig.cas.util.HttpClient; //导入依赖的package包/类
/**
* Build the logout manager.
* @param servicesManager the services manager.
* @param httpClient an HTTP client.
* @param logoutMessageBuilder the builder to construct logout messages.
*/
public LogoutManagerImpl(final ServicesManager servicesManager, final HttpClient httpClient,
final LogoutMessageCreator logoutMessageBuilder) {
this.servicesManager = servicesManager;
this.httpClient = httpClient;
this.logoutMessageBuilder = logoutMessageBuilder;
}
示例2: CasShibWebApplicationServiceImpl
import org.jasig.cas.util.HttpClient; //导入依赖的package包/类
private CasShibWebApplicationServiceImpl(final String id,
final String originalUrl, final String artifactId,
final ResponseType responseType, final HttpClient httpClient,
final String appNameOrPasscode) {
super(id, originalUrl, artifactId, httpClient);
this.responseType = responseType;
this.appNameOrPasscode = appNameOrPasscode;
}
示例3: CasShibSamlService
import org.jasig.cas.util.HttpClient; //导入依赖的package包/类
protected CasShibSamlService(final String id, final String originalUrl,
final String artifactId, final HttpClient httpClient,
final String requestId, final String appNameOrPasscode) {
super(id, originalUrl, artifactId, httpClient);
this.requestId = requestId;
this.appNameOrPasscode = appNameOrPasscode;
}
示例4: setHttpClient
import org.jasig.cas.util.HttpClient; //导入依赖的package包/类
public void setHttpClient(final HttpClient httpClient) {
this.httpClient = httpClient;
}
示例5: createServiceFrom
import org.jasig.cas.util.HttpClient; //导入依赖的package包/类
public static CasShibWebApplicationServiceImpl createServiceFrom(
final HttpServletRequest request, final HttpClient httpClient) {
final String targetService = request
.getParameter(CONST_PARAM_TARGET_SERVICE);
final String method = request.getParameter(CONST_PARAM_METHOD);
final String serviceToUse = StringUtils.hasText(targetService) ? targetService
: request.getParameter(CONST_PARAM_SERVICE);
if (!StringUtils.hasText(serviceToUse)) {
return null;
}
final String id = cleanupUrl(serviceToUse);
final String artifactId = request.getParameter(CONST_PARAM_TICKET);
// Extract the service passcode from url.
// URLs should be in the following format:
// /<contextPath>/shib/<appNameOrPasscode>/?
String appNameOrPasscode = null;
if ((request.getContextPath() != null ? request.getRequestURI()
.startsWith(request.getContextPath() + "/shib") : request
.getRequestURI().startsWith("/shib"))) {
String[] components = request.getRequestURI().substring(
(request.getContextPath() != null ? request.getContextPath()
.length() : 0)).split("/");
// 0 is the empty string before the first slash
// 1 should be the shibX string
// 2 should be the app name or passcode
// 3... should be everything after the app name or passcode
if (components.length > 3) {
appNameOrPasscode = components[2];
log
.debug("application name or passcode = "
+ appNameOrPasscode);
}
} else {
log.debug("no application name or passcode detected in url");
}
return new CasShibWebApplicationServiceImpl(id, serviceToUse,
artifactId, "POST".equals(method) ? ResponseType.POST
: ResponseType.REDIRECT, httpClient, appNameOrPasscode);
}
示例6: createServiceFrom
import org.jasig.cas.util.HttpClient; //导入依赖的package包/类
public static CasShibSamlService createServiceFrom(
final HttpServletRequest request, final HttpClient httpClient) {
final String service = request.getParameter(CONST_PARAM_SERVICE);
final String artifactId;
final String requestBody = getRequestBody(request);
final String requestId;
if (!StringUtils.hasText(service) && !StringUtils.hasText(requestBody)) {
return null;
}
final String id = cleanupUrl(service);
if (StringUtils.hasText(requestBody)) {
final String tagStart;
final String tagEnd;
if (requestBody.contains(CONST_START_ARTIFACT_XML_TAG)) {
tagStart = CONST_START_ARTIFACT_XML_TAG;
tagEnd = CONST_END_ARTIFACT_XML_TAG;
} else {
tagStart = CONST_START_ARTIFACT_XML_TAG_NO_NAMESPACE;
tagEnd = CONST_END_ARTIFACT_XML_TAG_NO_NAMESPACE;
}
final int startTagLocation = requestBody.indexOf(tagStart);
final int artifactStartLocation = startTagLocation + tagStart.length();
final int endTagLocation = requestBody.indexOf(tagEnd);
artifactId = requestBody.substring(artifactStartLocation, endTagLocation).trim();
// is there a request id?
requestId = extractRequestId(requestBody);
} else {
artifactId = null;
requestId = null;
}
// Extract the service passcode from url.
// URLs should be in the following format:
// /<contextPath>/shib/<appNameOrPasscode>/?
String appNameOrPasscode = null;
if ((request.getContextPath() != null ? request.getRequestURI()
.startsWith(request.getContextPath() + "/shib") : request
.getRequestURI().startsWith("/shib"))) {
String[] components = request.getRequestURI().substring(
(request.getContextPath() != null ? request.getContextPath()
.length() : 0)).split("/");
// 0 is the empty string before the first slash
// 1 should be the shibX string
// 2 should be the app name or passcode
// 3... should be everything after the app name or passcode
if (components.length > 3) {
appNameOrPasscode = components[2];
log
.debug("application name or passcode = "
+ appNameOrPasscode);
}
} else {
log.debug("no application name or passcode detected in url");
}
if (log.isDebugEnabled()) {
log.debug("Attempted to extract Request from HttpServletRequest. Results:");
log.debug(String.format("Request Body: %s", requestBody));
log.debug(String.format("Extracted ArtifactId: %s", artifactId));
log.debug(String.format("Extracted Request Id: %s", requestId));
}
return new CasShibSamlService(id, service, artifactId, httpClient,
requestId, appNameOrPasscode);
}
示例7: setHttpClient
import org.jasig.cas.util.HttpClient; //导入依赖的package包/类
/**
* Sets the HttpClient which will do all of the connection stuff.
* @param httpClient http client instance to use
**/
public void setHttpClient(final HttpClient httpClient) {
this.httpClient = httpClient;
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:8,代码来源:HttpBasedServiceCredentialsAuthenticationHandler.java