/** * Checks the response and if basic authentication is required then performs a new request * with basic authentication. * * @param request Request context. * @param response Response context (will be updated with newest response data if the request was repeated). * @return {@code true} if response does not require authentication or if authentication is required, * new request was done with digest authentication information and authentication was successful. * @throws ResponseAuthenticationException in case that basic credentials missing or are in invalid format */ public boolean filterResponseAndAuthenticate(ClientRequestContext request, ClientResponseContext response) { final String authenticate = response.getHeaders().getFirst(HttpHeaders.WWW_AUTHENTICATE); if (authenticate != null && authenticate.trim().toUpperCase().startsWith("BASIC")) { HttpAuthenticationFilter.Credentials credentials = HttpAuthenticationFilter .getCredentials(request, defaultCredentials, HttpAuthenticationFilter.Type.BASIC); if (credentials == null) { throw new ResponseAuthenticationException(null, LocalizationMessages.AUTHENTICATION_CREDENTIALS_MISSING_BASIC()); } return HttpAuthenticationFilter.repeatRequest(request, response, calculateAuthentication(credentials)); } return false; } }
/** * Checks the response and if basic authentication is required then performs a new request * with basic authentication. * * @param request Request context. * @param response Response context (will be updated with newest response data if the request was repeated). * @return {@code true} if response does not require authentication or if authentication is required, * new request was done with digest authentication information and authentication was successful. * @throws ResponseAuthenticationException in case that basic credentials missing or are in invalid format */ public boolean filterResponseAndAuthenticate(ClientRequestContext request, ClientResponseContext response) { final String authenticate = response.getHeaders().getFirst(HttpHeaders.WWW_AUTHENTICATE); if (authenticate != null && authenticate.trim().toUpperCase().startsWith("BASIC")) { HttpAuthenticationFilter.Credentials credentials = HttpAuthenticationFilter .getCredentials(request, defaultCredentials, HttpAuthenticationFilter.Type.BASIC); if (credentials == null) { throw new ResponseAuthenticationException(null, LocalizationMessages.AUTHENTICATION_CREDENTIALS_MISSING_BASIC()); } return HttpAuthenticationFilter.repeatRequest(request, response, calculateAuthentication(credentials)); } return false; } }
/** * Checks the response and if basic authentication is required then performs a new request * with basic authentication. * * @param request Request context. * @param response Response context (will be updated with newest response data if the request was repeated). * @return {@code true} if response does not require authentication or if authentication is required, * new request was done with digest authentication information and authentication was successful. * @throws ResponseAuthenticationException in case that basic credentials missing or are in invalid format */ public boolean filterResponseAndAuthenticate(ClientRequestContext request, ClientResponseContext response) { final String authenticate = response.getHeaders().getFirst(HttpHeaders.WWW_AUTHENTICATE); if (authenticate != null && authenticate.trim().toUpperCase().startsWith("BASIC")) { HttpAuthenticationFilter.Credentials credentials = HttpAuthenticationFilter .getCredentials(request, defaultCredentials, HttpAuthenticationFilter.Type.BASIC); if (credentials == null) { throw new ResponseAuthenticationException(null, LocalizationMessages.AUTHENTICATION_CREDENTIALS_MISSING_BASIC()); } return HttpAuthenticationFilter.repeatRequest(request, response, calculateAuthentication(credentials)); } return false; } }
final boolean success = HttpAuthenticationFilter.repeatRequest(request, response, createNextAuthToken(digestScheme, request, cred)); if (success) {
final boolean success = HttpAuthenticationFilter.repeatRequest(request, response, createNextAuthToken(digestScheme, request, cred)); if (success) {
final boolean success = HttpAuthenticationFilter.repeatRequest(request, response, createNextAuthToken(digestScheme, request, cred)); if (success) {
/** * Checks the response and if basic authentication is required then performs a new request * with basic authentication. * * @param request Request context. * @param response Response context (will be updated with newest response data if the request was repeated). * @return {@code true} if response does not require authentication or if authentication is required, * new request was done with digest authentication information and authentication was successful. * @throws ResponseAuthenticationException in case that basic credentials missing or are in invalid format */ public boolean filterResponseAndAuthenticate(ClientRequestContext request, ClientResponseContext response) { final String authenticate = response.getHeaders().getFirst(HttpHeaders.WWW_AUTHENTICATE); if (authenticate != null && authenticate.trim().toUpperCase().startsWith("BASIC")) { HttpAuthenticationFilter.Credentials credentials = HttpAuthenticationFilter .getCredentials(request, defaultCredentials, HttpAuthenticationFilter.Type.BASIC); if (credentials == null) { throw new ResponseAuthenticationException(null, LocalizationMessages.AUTHENTICATION_CREDENTIALS_MISSING_BASIC()); } return HttpAuthenticationFilter.repeatRequest(request, response, calculateAuthentication(credentials)); } return false; } }
/** * Checks the response and if basic authentication is required then performs a new request * with basic authentication. * * @param request Request context. * @param response Response context (will be updated with newest response data if the request was repeated). * @return {@code true} if response does not require authentication or if authentication is required, * new request was done with digest authentication information and authentication was successful. * @throws ResponseAuthenticationException in case that basic credentials missing or are in invalid format */ public boolean filterResponseAndAuthenticate(ClientRequestContext request, ClientResponseContext response) { final String authenticate = response.getHeaders().getFirst(HttpHeaders.WWW_AUTHENTICATE); if (authenticate != null && authenticate.trim().toUpperCase().startsWith("BASIC")) { HttpAuthenticationFilter.Credentials credentials = HttpAuthenticationFilter .getCredentials(request, defaultCredentials, HttpAuthenticationFilter.Type.BASIC); if (credentials == null) { throw new ResponseAuthenticationException(null, LocalizationMessages.AUTHENTICATION_CREDENTIALS_MISSING_BASIC()); } return HttpAuthenticationFilter.repeatRequest(request, response, calculateAuthentication(credentials)); } return false; } }
/** * Checks the response and if basic authentication is required then performs a new request * with basic authentication. * * @param request Request context. * @param response Response context (will be updated with newest response data if the request was repeated). * @return {@code true} if response does not require authentication or if authentication is required, * new request was done with digest authentication information and authentication was successful. * @throws ResponseAuthenticationException in case that basic credentials missing or are in invalid format */ public boolean filterResponseAndAuthenticate(ClientRequestContext request, ClientResponseContext response) { final String authenticate = response.getHeaders().getFirst(HttpHeaders.WWW_AUTHENTICATE); if (authenticate != null && authenticate.trim().toUpperCase().startsWith("BASIC")) { HttpAuthenticationFilter.Credentials credentials = HttpAuthenticationFilter .getCredentials(request, defaultCredentials, HttpAuthenticationFilter.Type.BASIC); if (credentials == null) { throw new ResponseAuthenticationException(null, LocalizationMessages.AUTHENTICATION_CREDENTIALS_MISSING_BASIC()); } return HttpAuthenticationFilter.repeatRequest(request, response, calculateAuthentication(credentials)); } return false; } }
/** * Checks the response and if basic authentication is required then performs a new request * with basic authentication. * * @param request Request context. * @param response Response context (will be updated with newest response data if the request was repeated). * @return {@code true} if response does not require authentication or if authentication is required, * new request was done with digest authentication information and authentication was successful. * @throws ResponseAuthenticationException in case that basic credentials missing or are in invalid format */ public boolean filterResponseAndAuthenticate(ClientRequestContext request, ClientResponseContext response) { final String authenticate = response.getHeaders().getFirst(HttpHeaders.WWW_AUTHENTICATE); if (authenticate != null && authenticate.trim().toUpperCase().startsWith("BASIC")) { HttpAuthenticationFilter.Credentials credentials = HttpAuthenticationFilter .getCredentials(request, defaultCredentials, HttpAuthenticationFilter.Type.BASIC); if (credentials == null) { throw new ResponseAuthenticationException(null, LocalizationMessages.AUTHENTICATION_CREDENTIALS_MISSING_BASIC()); } return HttpAuthenticationFilter.repeatRequest(request, response, calculateAuthentication(credentials)); } return false; } }
final boolean success = HttpAuthenticationFilter.repeatRequest(request, response, createNextAuthToken(digestScheme, request, cred)); if (success) {
final boolean success = HttpAuthenticationFilter.repeatRequest(request, response, createNextAuthToken(digestScheme, request, cred)); if (success) {
final boolean success = HttpAuthenticationFilter.repeatRequest(request, response, createNextAuthToken(digestScheme, request, cred)); if (success) {
final boolean success = HttpAuthenticationFilter.repeatRequest(request, response, createNextAuthToken(digestScheme, request, cred)); if (success) {