Azure / azure-storage-java

Microsoft Azure Storage Library for Java
https://docs.microsoft.com/en-us/java/api/overview/azure/storage
MIT License
189 stars 165 forks source link

need to a way to auth proxy server to list blobs #569

Open VigneswaranAnusuya opened 2 years ago

VigneswaranAnusuya commented 2 years ago

Which service(blob, file, queue, table) does this issue concern?

blob

Which version of the SDK was used?

Please note that if your issue is with v11, we are recommending customers either move back to v11 or move to v12 (currently in preview) if at all possible. Hopefully this resolves your issue, but if there is some reason why moving away from v11 is not possible at this time, please do continue to ask your question and we will do our best to support you. The README for this SDK has been updated to point to more information on why we have made this decision. java 8

What problem was encountered?

I'm using java8 SDK. I need to authenticate my calls via a proxy server. My code works fine on a no proxy environment. I have the proxy server's password and user name. Need a way to make the request pass through!!

Have you found a mitigation/solution?

error facing: com.microsoft.azure.storage.StorageException: Proxy Authentication Required at com.microsoft.azure.storage.StorageException.translateException(StorageException.java:87) at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:220) Tried: import static io.cloudslang.content.azure.utils.HttpUtils.getProxy; Proxy proxy = getProxy(host,port,userName,password);

        OperationContext op = new OperationContext();
        op.setProxy(proxy);

blobClient.listContainersSegmented("",null,2,null,null,op);

        OperationContext.setDefaultProxy(proxy);

blobClient.listContainersSegmented("",null,2,null,null,op);

        Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("xxxx",123));
        OperationContext op = new OperationContext();
        op.setProxy(proxy);
        op.setProxyUsername(userName);
        op.setProxyPassword(password);

blobClient.listContainersSegmented("",null,2,null,null,op);