Skip to content

Commit 5fbe162

Browse files
committed
Review authentication flow.
1 parent 62392c4 commit 5fbe162

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hub/src/main/java/ch/iterate/hub/protocols/s3/S3AutoLoadVaultSession.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,17 @@ public RequestEntityRestStorageService open(final ProxyFinder proxy, final HostK
7070
return super.open(proxy, hostcallback, login, cancel);
7171
}
7272

73+
/**
74+
* Unlock vault using universal vault format metadata payload after verifying credentials
75+
*/
7376
@Override
7477
public void login(final LoginCallback prompt, final CancelCallback cancel) throws BackgroundException {
7578
try {
7679
final Credentials credentials = backend.getHost().getCredentials().withOauth(keychain.findOAuthTokens(backend.getHost()));
77-
log.debug("Login to {} with credentials {}", backend.getHost(), credentials);
80+
log.debug("Verify credentials {} with {}", credentials, backend);
7881
backend.login(prompt, cancel);
82+
log.debug("Verify credentials {} with {}", host.getCredentials(), host);
83+
super.login(prompt, cancel);
7984
final Path home = new DelegatingHomeFeature(new DefaultPathHomeFeature(host)).find();
8085
log.debug("Attempting to locate vault in {}", home);
8186
final Vault vault = VaultFactory.get(home);
@@ -97,6 +102,5 @@ public Credentials prompt(final Host bookmark, final String title, final String
97102
catch(ApiException | SecurityFailure | AccessException e) {
98103
throw new LoginFailureException(LocaleFactory.localizedString("Login failed", "Credentials"), e);
99104
}
100-
super.login(prompt, cancel);
101105
}
102106
}

0 commit comments

Comments
 (0)