When the below section of code is executed in my program I get an IOException.
try(BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(logStorageUrl.openStream()))) {
String currentLine;
while((currentLine = bufferedReader.readLine()) != null){
Vault vlt = mapper.readValue(currentLine, Vault.class);
logger.debug("Log Store Name: " + vlt.getvault_name());
logger.debug("Log Store Vault: " + vault);
if(vlt.getvault_name().equals(vault.toLowerCase())){
logger.debug("Per Vault Total log_store vault name: " + vlt.getvault_name() + ", bytes: " + vlt.getBytes());
byteCount += vlt.getBytes();
}
}
logger.debug("Total LogStore ByteCount: " + byteCount);
} catch(IOException e){
System.out.println("IO Exception " + e );
}
Here's the exception details:
IO Exception java.io.IOException: Server returned HTTP response code: 403 for URL: https://s3-api.XXXXXX.net/cr-test
I suspect it might be related to aws v4 authentication as that's the method I'm using and I already hit an issue with it but that seems to be resolved. Could it be something missing in my header? My previous issue was due to not passing 'host' in my header but I included it this time.
I know I passed the correct access and secret keys and I didn't select any particular headers to pass.