/** * Look for an OAuth protocol problem. For cases where no access token is in play * @param response * @throws OAuthProtocolException */ private void checkForProtocolProblem(HttpResponse response) throws OAuthProtocolException { if (couldBeFullOAuthError(response)) { // OK, might be OAuth related. OAuthMessage message = parseAuthHeader(null, response); if (OAuthUtil.getParameter(message, OAuthProblemException.OAUTH_PROBLEM) != null) { // SP reported extended error information throw new OAuthProtocolException(response.getHttpStatusCode(), message); } // No extended information, guess based on HTTP response code. if (response.getHttpStatusCode() == HttpResponse.SC_UNAUTHORIZED) { throw new OAuthProtocolException(response.getHttpStatusCode()); } } }
/** * Look for an OAuth protocol problem. For cases where no access token is in play * @param response * @throws OAuthProtocolException */ private void checkForProtocolProblem(HttpResponse response) throws OAuthProtocolException { if (couldBeFullOAuthError(response)) { // OK, might be OAuth related. OAuthMessage message = parseAuthHeader(null, response); if (OAuthUtil.getParameter(message, OAuthProblemException.OAUTH_PROBLEM) != null) { // SP reported extended error information throw new OAuthProtocolException(response.getHttpStatusCode(), message); } // No extended information, guess based on HTTP response code. if (response.getHttpStatusCode() == HttpResponse.SC_UNAUTHORIZED) { throw new OAuthProtocolException(response.getHttpStatusCode()); } } }
/** * Look for an OAuth protocol problem. For cases where no access token is in play * @param response * @throws OAuthProtocolException */ private void checkForProtocolProblem(HttpResponse response) throws OAuthProtocolException { if (couldBeFullOAuthError(response)) { // OK, might be OAuth related. OAuthMessage message = parseAuthHeader(null, response); if (OAuthUtil.getParameter(message, OAuthProblemException.OAUTH_PROBLEM) != null) { // SP reported extended error information throw new OAuthProtocolException(response.getHttpStatusCode(), message); } // No extended information, guess based on HTTP response code. if (response.getHttpStatusCode() == HttpResponse.SC_UNAUTHORIZED) { throw new OAuthProtocolException(response.getHttpStatusCode()); } } }