diff --git a/azure/pom.xml b/azure/pom.xml
index ca2bfd888ef..37ad6e0ce54 100644
--- a/azure/pom.xml
+++ b/azure/pom.xml
@@ -31,6 +31,11 @@
core
${project.version}
+
+ ch.cyberduck
+ oauth
+ ${project.version}
+
ch.cyberduck
test
diff --git a/azure/src/main/java/ch/cyberduck/core/azure/AzureSession.java b/azure/src/main/java/ch/cyberduck/core/azure/AzureSession.java
index b6a4873aea9..efc9c2ff081 100644
--- a/azure/src/main/java/ch/cyberduck/core/azure/AzureSession.java
+++ b/azure/src/main/java/ch/cyberduck/core/azure/AzureSession.java
@@ -89,7 +89,6 @@ protected BlobServiceClient connect(final ProxyFinder proxy, final HostKeyCallba
.pipeline(new HttpPipelineBuilder()
.httpClient(new ApacheHttpClient(pool))
.policies(
- new EmptyAuthenticationPolicy(),
new UserAgentPolicy(new PreferencesUseragentProvider().get()),
new RequestIdPolicy(),
new RequestRetryPolicy(new RequestRetryOptions()),
@@ -118,11 +117,13 @@ public void setCredentials(final Credentials credentials) {
@Override
public Mono process(final HttpPipelineCallContext context, final HttpPipelineNextPolicy next) {
if(credentials.isTokenAuthentication()) {
- return new AzureSasCredentialPolicy(new AzureSasCredential(
- credentials.getToken())).process(context, next);
+ return new AzureSasCredentialPolicy(new AzureSasCredential(credentials.getToken())).process(context, next);
}
- return new StorageSharedKeyCredentialPolicy(new StorageSharedKeyCredential(
- credentials.getUsername(), credentials.getPassword())).process(context, next);
+ if(credentials.isPasswordAuthentication()) {
+ return new StorageSharedKeyCredentialPolicy(new StorageSharedKeyCredential(
+ credentials.getUsername(), credentials.getPassword())).process(context, next);
+ }
+ return next.process();
}
}
@@ -199,20 +200,4 @@ public T _getFeature(final Class type) {
}
return super._getFeature(type);
}
-
- private static final class EmptyAuthenticationPolicy extends BearerTokenAuthenticationPolicy {
- public EmptyAuthenticationPolicy() {
- super(request -> Mono.empty());
- }
-
- @Override
- public HttpResponse processSync(final HttpPipelineCallContext context, final HttpPipelineNextSyncPolicy next) {
- return next.processSync();
- }
-
- @Override
- public Mono process(final HttpPipelineCallContext context, final HttpPipelineNextPolicy next) {
- return next.process();
- }
- }
}