diff --git a/s3/src/main/java/ch/cyberduck/core/s3/S3Session.java b/s3/src/main/java/ch/cyberduck/core/s3/S3Session.java index 18afce5c458..d9aa7c4eda5 100644 --- a/s3/src/main/java/ch/cyberduck/core/s3/S3Session.java +++ b/s3/src/main/java/ch/cyberduck/core/s3/S3Session.java @@ -194,10 +194,11 @@ protected RequestEntityRestStorageService connect(final Proxy proxy, final HostK .withRedirectUri(host.getProtocol().getOAuthRedirectUrl()) .withFlowType(OAuth2AuthorizationService.FlowType.valueOf(host.getProtocol().getAuthorization())); configuration.addInterceptorLast(oauth); - final STSAssumeRoleCredentialsRequestInterceptor sts = new STSAssumeRoleCredentialsRequestInterceptor(oauth, this, trust, key, prompt, cancel); - configuration.addInterceptorLast(sts); - configuration.setServiceUnavailableRetryStrategy(new S3AuthenticationResponseInterceptor(this, sts)); - authentication = sts; + final STSAssumeRoleCredentialsRequestInterceptor interceptor + = new STSAssumeRoleCredentialsRequestInterceptor(oauth, this, trust, key, prompt); + configuration.addInterceptorLast(interceptor); + configuration.setServiceUnavailableRetryStrategy(new S3AuthenticationResponseInterceptor(this, interceptor)); + authentication = interceptor; } else { if(S3Session.isAwsHostname(host.getHostname())) { diff --git a/s3/src/main/java/ch/cyberduck/core/sts/STSAssumeRoleCredentialsRequestInterceptor.java b/s3/src/main/java/ch/cyberduck/core/sts/STSAssumeRoleCredentialsRequestInterceptor.java index 77095eeebfa..4883e3a124d 100644 --- a/s3/src/main/java/ch/cyberduck/core/sts/STSAssumeRoleCredentialsRequestInterceptor.java +++ b/s3/src/main/java/ch/cyberduck/core/sts/STSAssumeRoleCredentialsRequestInterceptor.java @@ -16,7 +16,6 @@ */ import ch.cyberduck.core.Credentials; -import ch.cyberduck.core.Host; import ch.cyberduck.core.HostPasswordStore; import ch.cyberduck.core.LoginCallback; import ch.cyberduck.core.OAuthTokens; @@ -29,7 +28,6 @@ import ch.cyberduck.core.s3.S3Session; import ch.cyberduck.core.ssl.X509KeyManager; import ch.cyberduck.core.ssl.X509TrustManager; -import ch.cyberduck.core.threading.CancelCallback; import org.apache.http.HttpException; import org.apache.http.HttpRequest; @@ -61,17 +59,13 @@ public class STSAssumeRoleCredentialsRequestInterceptor extends STSAssumeRoleAut */ private final OAuth2RequestInterceptor oauth; private final S3Session session; - private final Host host; - private final CancelCallback cancel; public STSAssumeRoleCredentialsRequestInterceptor(final OAuth2RequestInterceptor oauth, final S3Session session, final X509TrustManager trust, final X509KeyManager key, - final LoginCallback prompt, final CancelCallback cancel) { + final LoginCallback prompt) { super(session.getHost(), trust, key, prompt); this.oauth = oauth; this.session = session; - this.host = session.getHost(); - this.cancel = cancel; } public TemporaryAccessTokens refresh(final OAuthTokens oidc) throws BackgroundException {