private void addBasicAuthentication ( OAuthClientRequest request , RedditApp app ) { String authString = app . getClientID ( ) + ":" + app . getClientSecret ( ) ; String authStringEnc = DatatypeConverter . printBase64Binary ( authString . getBytes ( ) ) ; request . addHeader ( HEADER_AUTHORIZATION , "Basic " + authStringEnc ) ; }
Add the basic authentication protocol to the OAuth request using the credentials of the Reddit application provided .