Skip to content

Commit 62c519b

Browse files
committed
Initialize with previously saved tokens if any.
1 parent 6f02aff commit 62c519b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

oauth/src/main/java/ch/cyberduck/core/oauth/OAuth2RequestInterceptor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class OAuth2RequestInterceptor extends OAuth2AuthorizationService impleme
5050
/**
5151
* Currently valid tokens
5252
*/
53-
private OAuthTokens tokens = OAuthTokens.EMPTY;
53+
private OAuthTokens tokens;
5454

5555
public OAuth2RequestInterceptor(final HttpClient client, final Host host, final LoginCallback prompt) throws LoginCanceledException {
5656
this(client, host,
@@ -67,6 +67,7 @@ public OAuth2RequestInterceptor(final HttpClient client, final Host host, final
6767
public OAuth2RequestInterceptor(final HttpClient client, final Host host, final String tokenServerUrl, final String authorizationServerUrl,
6868
final String clientid, final String clientsecret, final List<String> scopes, final boolean pkce, final LoginCallback prompt) throws LoginCanceledException {
6969
super(client, host, tokenServerUrl, authorizationServerUrl, clientid, clientsecret, scopes, pkce, prompt);
70+
this.tokens = host.getCredentials().getOauth();
7071
}
7172

7273
@Override

s3/src/main/java/ch/cyberduck/core/sts/STSRequestInterceptor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public abstract class STSRequestInterceptor extends STSAuthorizationService impl
4646
/**
4747
* Currently valid tokens obtained from token service
4848
*/
49-
protected TemporaryAccessTokens tokens = TemporaryAccessTokens.EMPTY;
49+
protected TemporaryAccessTokens tokens;
5050

5151
/**
5252
* Static long-lived credentials
@@ -56,6 +56,7 @@ public abstract class STSRequestInterceptor extends STSAuthorizationService impl
5656
public STSRequestInterceptor(final Host host, final X509TrustManager trust, final X509KeyManager key, final LoginCallback prompt) {
5757
super(host, trust, key, prompt);
5858
this.credentials = new CopyCredentialsHolder(host.getCredentials());
59+
this.tokens = host.getCredentials().getTokens();
5960
}
6061

6162
/**

0 commit comments

Comments
 (0)