Skip to content

Commit

Permalink
Make flow type optional in profile configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Sep 22, 2023
1 parent 778b491 commit 8f99afa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ protected HttpClientBuilder getConfiguration(final Proxy proxy, final LoginCallb
final HttpClientBuilder configuration = super.getConfiguration(proxy, prompt);
if(host.getProtocol().isOAuthConfigurable()) {
authorizationService = new OAuth2RequestInterceptor(configuration.build(), host, prompt)
.withFlowType(OAuth2AuthorizationService.FlowType.valueOf(host.getProtocol().getAuthorization()))
.withRedirectUri(host.getProtocol().getOAuthRedirectUrl());
if(host.getProtocol().getAuthorization() != null) {
authorizationService.withFlowType(OAuth2AuthorizationService.FlowType.valueOf(host.getProtocol().getAuthorization()));
}
configuration.addInterceptorLast(authorizationService);
configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(host, authorizationService));
}
Expand Down
6 changes: 4 additions & 2 deletions s3/src/main/java/ch/cyberduck/core/s3/S3Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,10 @@ protected RequestEntityRestStorageService connect(final Proxy proxy, final HostK
if(host.getProtocol().isOAuthConfigurable()) {
final OAuth2RequestInterceptor oauth = new OAuth2RequestInterceptor(builder.build(ProxyFactory.get()
.find(host.getProtocol().getOAuthAuthorizationUrl()), this, prompt).build(), host, prompt)
.withRedirectUri(host.getProtocol().getOAuthRedirectUrl())
.withFlowType(OAuth2AuthorizationService.FlowType.valueOf(host.getProtocol().getAuthorization()));
.withRedirectUri(host.getProtocol().getOAuthRedirectUrl());
if(host.getProtocol().getAuthorization() != null) {
oauth.withFlowType(OAuth2AuthorizationService.FlowType.valueOf(host.getProtocol().getAuthorization()));
}
configuration.addInterceptorLast(oauth);
final STSAssumeRoleCredentialsRequestInterceptor interceptor
= new STSAssumeRoleCredentialsRequestInterceptor(oauth, this, trust, key, prompt);
Expand Down

0 comments on commit 8f99afa

Please sign in to comment.