Skip to content

Commit

Permalink
Support bearer token for non-webdav requests
Browse files Browse the repository at this point in the history
  • Loading branch information
raboof committed Aug 26, 2023
1 parent d19cded commit d02f516
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ private <R> CompletableFuture<R> executeRequest(final ResponseParser<R> parser,
// https://docs.nextcloud.com/server/14/developer_manual/core/ocs-share-api.html
request.addHeader("OCS-APIRequest", "true");
request.addHeader("Content-Type", "application/x-www-form-urlencoded");
if (serverConfig.getAuthenticationConfig().usesBearerTokenAuthentication()) {
request.addHeader("Authorization", "Bearer " + serverConfig.getAuthenticationConfig().getBearerToken());
}
request.setProtocolVersion(HttpVersion.HTTP_1_1);

HttpClientContext context = prepareContext();
Expand Down

0 comments on commit d02f516

Please sign in to comment.