Skip to content

Commit

Permalink
Merge pull request #83 from raboof/support-bearer-token-for-non-webda…
Browse files Browse the repository at this point in the history
…v-requests2

Support bearer token for non-webdav requests
  • Loading branch information
a-schild authored Sep 29, 2023
2 parents d19cded + d02f516 commit 65a502e
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 65a502e

Please sign in to comment.