/** * Sets the list of authentication requests sent by an origin server to a * client. Note that when used with HTTP connectors, this property maps to * the "WWW-Authenticate" header. This method clears the current list and * adds all entries in the parameter list. * * @param challengeRequests * A list of authentication requests sent by an origin server to * a client. */ public void setChallengeRequests(List<ChallengeRequest> challengeRequests) { synchronized (getChallengeRequests()) { if (challengeRequests != getChallengeRequests()) { getChallengeRequests().clear(); if (challengeRequests != null) { getChallengeRequests().addAll(challengeRequests); } } } }
/** * Returns the list of authentication requests sent by an origin server to a * client. * * @return The list of authentication requests sent by an origin server to a * client. */ @Override public List<ChallengeRequest> getChallengeRequests() { return getWrappedResponse().getChallengeRequests(); }
/** * Returns the list of authentication requests sent by an origin server to a * client. If none is available, an empty list is returned. * * @return The list of authentication requests. * @see Response#getChallengeRequests() */ public List<ChallengeRequest> getChallengeRequests() { return getResponse() == null ? null : getResponse() .getChallengeRequests(); }
/** * Challenges the client by adding a challenge request to the response and * by setting the status to {@link Status#CLIENT_ERROR_UNAUTHORIZED}. * * @param response * The response to update. * @param stale * Indicates if the new challenge is due to a stale response. */ public void challenge(Response response, boolean stale) { boolean loggable = response.getRequest().isLoggable() && getLogger().isLoggable(Level.FINE); if (loggable) { getLogger().log(Level.FINE, "An authentication challenge was requested."); } response.setStatus(Status.CLIENT_ERROR_UNAUTHORIZED); response.getChallengeRequests().add(createChallengeRequest(stale)); }
response.getChallengeRequests().clear();
response.getChallengeRequests().clear();
List<ChallengeRequest> crs = org.restlet.engine.security.AuthenticatorUtils .parseRequest(response, header.getValue(), headers); response.getChallengeRequests().addAll(crs); } else if (HEADER_PROXY_AUTHENTICATE.equalsIgnoreCase(header.getName())) { List<ChallengeRequest> crs = org.restlet.engine.security.AuthenticatorUtils
ChallengeRequest challengeRequest = null; for (ChallengeRequest c : response.getChallengeRequests()) { if (challengeResponse.getScheme().equals(c.getScheme())) { challengeRequest = c;
if (response.getChallengeRequests() != null) { for (ChallengeRequest challengeRequest : response.getChallengeRequests()) { addHeader(HEADER_WWW_AUTHENTICATE, org.restlet.engine.security.AuthenticatorUtils