/** * Update a response with additional data to be returned to the application. */ public void addToResponse(HttpResponseBuilder response, OAuthRequestException e) { if (!newClientState.isEmpty()) { try { response.setMetadata(CLIENT_STATE, newClientState.getEncryptedState()); } catch (BlobCrypterException cryptException) { // Configuration error somewhere, this should never happen. throw new RuntimeException(cryptException); } } if (aznUrl != null) { response.setMetadata(APPROVAL_URL, aznUrl); } if (e != null || sendTraceToClient) { StringBuilder verboseError = new StringBuilder(); if (e != null) { response.setMetadata(ERROR_CODE, e.getError()); verboseError.append(e.getErrorText()); } if (sendTraceToClient) { verboseError.append('\n'); verboseError.append(getRequestTrace()); } response.setMetadata(ERROR_TEXT, verboseError.toString()); } }
/** * Update a response with additional data to be returned to the application. */ public void addToResponse(HttpResponseBuilder response, OAuthRequestException e) { if (!newClientState.isEmpty()) { try { response.setMetadata(CLIENT_STATE, newClientState.getEncryptedState()); } catch (BlobCrypterException cryptException) { // Configuration error somewhere, this should never happen. throw new RuntimeException(cryptException); } } if (aznUrl != null) { response.setMetadata(APPROVAL_URL, aznUrl); } if (e != null || sendTraceToClient) { StringBuilder verboseError = new StringBuilder(); if (e != null) { response.setMetadata(ERROR_CODE, e.getError()); verboseError.append(e.getErrorText()); } if (sendTraceToClient) { verboseError.append('\n'); verboseError.append(getRequestTrace()); } response.setMetadata(ERROR_TEXT, verboseError.toString()); } }
/** * Update a response with additional data to be returned to the application. */ public void addToResponse(HttpResponseBuilder response, OAuthRequestException e) { if (!newClientState.isEmpty()) { try { response.setMetadata(CLIENT_STATE, newClientState.getEncryptedState()); } catch (BlobCrypterException cryptException) { // Configuration error somewhere, this should never happen. throw new RuntimeException(cryptException); } } if (aznUrl != null) { response.setMetadata(APPROVAL_URL, aznUrl); } if (e != null || sendTraceToClient) { StringBuilder verboseError = new StringBuilder(); if (e != null) { response.setMetadata(ERROR_CODE, e.getError()); verboseError.append(e.getErrorText()); } if (sendTraceToClient) { verboseError.append('\n'); verboseError.append(getRequestTrace()); } response.setMetadata(ERROR_TEXT, verboseError.toString()); } }
private void assertEmpty(OAuthClientState state) { assertTrue(state.isEmpty()); assertNull(state.getRequestToken()); assertNull(state.getRequestTokenSecret()); assertNull(state.getAccessToken()); assertNull(state.getAccessTokenSecret()); assertNull(state.getOwner()); }
private void assertEmpty(OAuthClientState state) { assertTrue(state.isEmpty()); assertNull(state.getRequestToken()); assertNull(state.getRequestTokenSecret()); assertNull(state.getAccessToken()); assertNull(state.getAccessTokenSecret()); assertNull(state.getOwner()); }
private void assertEmpty(OAuthClientState state) { assertTrue(state.isEmpty()); assertNull(state.getRequestToken()); assertNull(state.getRequestTokenSecret()); assertNull(state.getAccessToken()); assertNull(state.getAccessTokenSecret()); assertNull(state.getOwner()); }