Java 类org.apache.http.auth.ChallengeState 实例源码
项目:webmagic
文件:HttpUriRequestConverter.java
private HttpClientContext convertHttpClientContext(Request request, Site site, Proxy proxy) {
HttpClientContext httpContext = new HttpClientContext();
if (proxy != null && proxy.getUsername() != null) {
AuthState authState = new AuthState();
authState.update(new BasicScheme(ChallengeState.PROXY), new UsernamePasswordCredentials(proxy.getUsername(), proxy.getPassword()));
httpContext.setAttribute(HttpClientContext.PROXY_AUTH_STATE, authState);
}
if (request.getCookies() != null && !request.getCookies().isEmpty()) {
CookieStore cookieStore = new BasicCookieStore();
for (Map.Entry<String, String> cookieEntry : request.getCookies().entrySet()) {
BasicClientCookie cookie1 = new BasicClientCookie(cookieEntry.getKey(), cookieEntry.getValue());
cookie1.setDomain(UrlUtils.removePort(UrlUtils.getDomain(request.getUrl())));
cookieStore.addCookie(cookie1);
}
httpContext.setCookieStore(cookieStore);
}
return httpContext;
}
项目:purecloud-iot
文件:RFC2617Scheme.java
@SuppressWarnings("unchecked")
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
this.credentialsCharset = CharsetUtils.get(in.readUTF());
if (this.credentialsCharset == null) {
this.credentialsCharset = Consts.ASCII;
}
this.challengeState = (ChallengeState) in.readObject();
}
项目:artifactory
文件:ProxyPreemptiveAuthInterceptor.java
@Override
public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {
HttpClientContext clientContext = HttpClientContext.adapt(context);
AuthState proxyAuthState = clientContext.getProxyAuthState();
// If there's no auth scheme available yet, try to initialize it preemptively
if (proxyAuthState.getAuthScheme() == null) {
CredentialsProvider credsProvider = clientContext.getCredentialsProvider();
RouteInfo route = clientContext.getHttpRoute();
if (route == null) {
log.debug("No route found for {}", clientContext.getTargetHost());
return;
}
HttpHost proxyHost = route.getProxyHost();
if (proxyHost == null) {
log.warn("No proxy host found in route {} for host {}", route, clientContext.getTargetHost());
return;
}
Credentials creds = credsProvider.getCredentials(
new AuthScope(proxyHost.getHostName(), proxyHost.getPort()));
if (creds == null) {
log.info("No credentials found for proxy: " + proxyHost);
return;
}
proxyAuthState.update(new BasicScheme(ChallengeState.PROXY), creds);
}
}
项目:remote-files-sync
文件:RFC2617SchemeHC4.java
/**
* Creates an instance of <tt>RFC2617Scheme</tt> with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public RFC2617SchemeHC4(final ChallengeState challengeState) {
super(challengeState);
this.params = new HashMap<String, String>();
this.credentialsCharset = Consts.ASCII;
}
项目:purecloud-iot
文件:RFC2617Scheme.java
/**
* Creates an instance of {@code RFC2617Scheme} with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public RFC2617Scheme(final ChallengeState challengeState) {
super(challengeState);
this.params = new HashMap<String, String>();
this.credentialsCharset = Consts.ASCII;
}
项目:Visit
文件:RFC2617SchemeHC4.java
/**
* Creates an instance of <tt>RFC2617Scheme</tt> with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public RFC2617SchemeHC4(final ChallengeState challengeState) {
super(challengeState);
this.params = new HashMap<String, String>();
this.credentialsCharset = Consts.ASCII;
}
项目:ZTLib
文件:RFC2617SchemeHC4.java
/**
* Creates an instance of <tt>RFC2617Scheme</tt> with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public RFC2617SchemeHC4(final ChallengeState challengeState) {
super(challengeState);
this.params = new HashMap<String, String>();
this.credentialsCharset = Consts.ASCII;
}
项目:lams
文件:RFC2617Scheme.java
/**
* Creates an instance of <tt>RFC2617Scheme</tt> with the given challenge
* state.
*
* @since 4.2
*/
public RFC2617Scheme(final ChallengeState challengeState) {
super(challengeState);
this.params = new HashMap<String, String>();
}
项目:lams
文件:DigestScheme.java
/**
* Creates an instance of <tt>DigestScheme</tt> with the given challenge
* state.
*
* @since 4.2
*/
public DigestScheme(final ChallengeState challengeState) {
super(challengeState);
this.complete = false;
}
项目:lams
文件:BasicScheme.java
/**
* Creates an instance of <tt>BasicScheme</tt> with the given challenge
* state.
*
* @since 4.2
*/
public BasicScheme(final ChallengeState challengeState) {
super(challengeState);
this.complete = false;
}
项目:lams
文件:AuthSchemeBase.java
/**
* Creates an instance of <tt>AuthSchemeBase</tt> with the given challenge
* state.
*
* @since 4.2
*/
public AuthSchemeBase(final ChallengeState challengeState) {
super();
this.challengeState = challengeState;
}
项目:lams
文件:AuthSchemeBase.java
/**
* Returns <code>true</code> if authenticating against a proxy, <code>false</code>
* otherwise.
*/
public boolean isProxy() {
return this.challengeState != null && this.challengeState == ChallengeState.PROXY;
}
项目:lams
文件:AuthSchemeBase.java
/**
* Returns {@link ChallengeState} value or <code>null</code> if unchallenged.
*
* @since 4.2
*/
public ChallengeState getChallengeState() {
return this.challengeState;
}
项目:remote-files-sync
文件:BasicSchemeHC4.java
/**
* Creates an instance of <tt>BasicScheme</tt> with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public BasicSchemeHC4(final ChallengeState challengeState) {
super(challengeState);
}
项目:remote-files-sync
文件:DigestSchemeHC4.java
/**
* Creates an instance of <tt>DigestScheme</tt> with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public DigestSchemeHC4(final ChallengeState challengeState) {
super(challengeState);
}
项目:remote-files-sync
文件:AuthSchemeBaseHC4.java
/**
* Creates an instance of <tt>AuthSchemeBase</tt> with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public AuthSchemeBaseHC4(final ChallengeState challengeState) {
super();
this.challengeState = challengeState;
}
项目:remote-files-sync
文件:AuthSchemeBaseHC4.java
/**
* Returns <code>true</code> if authenticating against a proxy, <code>false</code>
* otherwise.
*/
public boolean isProxy() {
return this.challengeState != null && this.challengeState == ChallengeState.PROXY;
}
项目:remote-files-sync
文件:AuthSchemeBaseHC4.java
/**
* Returns {@link ChallengeState} value or <code>null</code> if unchallenged.
*
* @since 4.2
*/
public ChallengeState getChallengeState() {
return this.challengeState;
}
项目:purecloud-iot
文件:DigestScheme.java
/**
* Creates an instance of {@code DigestScheme} with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public DigestScheme(final ChallengeState challengeState) {
super(challengeState);
}
项目:purecloud-iot
文件:BasicScheme.java
/**
* Creates an instance of {@code BasicScheme} with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public BasicScheme(final ChallengeState challengeState) {
super(challengeState);
}
项目:purecloud-iot
文件:AuthSchemeBase.java
/**
* Creates an instance of {@code AuthSchemeBase} with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public AuthSchemeBase(final ChallengeState challengeState) {
super();
this.challengeState = challengeState;
}
项目:purecloud-iot
文件:AuthSchemeBase.java
/**
* Returns {@code true} if authenticating against a proxy, {@code false}
* otherwise.
*/
public boolean isProxy() {
return this.challengeState != null && this.challengeState == ChallengeState.PROXY;
}
项目:purecloud-iot
文件:AuthSchemeBase.java
/**
* Returns {@link ChallengeState} value or {@code null} if unchallenged.
*
* @since 4.2
*/
public ChallengeState getChallengeState() {
return this.challengeState;
}
项目:Visit
文件:BasicSchemeHC4.java
/**
* Creates an instance of <tt>BasicScheme</tt> with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public BasicSchemeHC4(final ChallengeState challengeState) {
super(challengeState);
}
项目:Visit
文件:DigestSchemeHC4.java
/**
* Creates an instance of <tt>DigestScheme</tt> with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public DigestSchemeHC4(final ChallengeState challengeState) {
super(challengeState);
}
项目:Visit
文件:AuthSchemeBaseHC4.java
/**
* Creates an instance of <tt>AuthSchemeBase</tt> with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public AuthSchemeBaseHC4(final ChallengeState challengeState) {
super();
this.challengeState = challengeState;
}
项目:Visit
文件:AuthSchemeBaseHC4.java
/**
* Returns <code>true</code> if authenticating against a proxy, <code>false</code>
* otherwise.
*/
public boolean isProxy() {
return this.challengeState != null && this.challengeState == ChallengeState.PROXY;
}
项目:Visit
文件:AuthSchemeBaseHC4.java
/**
* Returns {@link ChallengeState} value or <code>null</code> if unchallenged.
*
* @since 4.2
*/
public ChallengeState getChallengeState() {
return this.challengeState;
}
项目:ZTLib
文件:BasicSchemeHC4.java
/**
* Creates an instance of <tt>BasicScheme</tt> with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public BasicSchemeHC4(final ChallengeState challengeState) {
super(challengeState);
}
项目:ZTLib
文件:DigestSchemeHC4.java
/**
* Creates an instance of <tt>DigestScheme</tt> with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public DigestSchemeHC4(final ChallengeState challengeState) {
super(challengeState);
}
项目:ZTLib
文件:AuthSchemeBaseHC4.java
/**
* Creates an instance of <tt>AuthSchemeBase</tt> with the given challenge
* state.
*
* @since 4.2
*
* @deprecated (4.3) do not use.
*/
@Deprecated
public AuthSchemeBaseHC4(final ChallengeState challengeState) {
super();
this.challengeState = challengeState;
}
项目:ZTLib
文件:AuthSchemeBaseHC4.java
/**
* Returns <code>true</code> if authenticating against a proxy, <code>false</code>
* otherwise.
*/
public boolean isProxy() {
return this.challengeState != null && this.challengeState == ChallengeState.PROXY;
}
项目:ZTLib
文件:AuthSchemeBaseHC4.java
/**
* Returns {@link ChallengeState} value or <code>null</code> if unchallenged.
*
* @since 4.2
*/
public ChallengeState getChallengeState() {
return this.challengeState;
}