LDAP with Keycloack on Nextcloud

Hello here, i’m a developer trying to implement a feature for my app.
I have to list the list of all files contained in a directory.
I’m developing with java and i’m having access to nextcloud by WEBDAV.

Every day there is a Job that take all the direcotry’s files.
Till now seem everything fine if i use a WEBDAV client as Sardine but i get a 401 error when i try to authenticate with a bearer token passed by my keycloack API server.

here it is a piece of my code while i request data from the nextcloud
Any suggestion is MUCH appreciated .

SardineImpl(initHttpClient());
---
List<DavResource> resources = sardine.list(url, -1);
---

public HttpClientBuilder initHttpClient() {
        final HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
        final List<Header> headers = new ArrayList<Header>();

        headers.add(new BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json"));
        headers.add(new BasicHeader(HttpHeaders.AUTHORIZATION, "Bearer " + password));
        headers.add(new BasicHeader("Accept", "*/*"));
        headers.add(new BasicHeader("User-Agent", HttpHeaders.USER_AGENT));

        httpClientBuilder.setDefaultHeaders(headers).build();
        httpClientBuilder.setRedirectStrategy(new LaxRedirectStrategy()).build();
        httpClientBuilder.setDefaultRequestConfig(RequestConfig.custom().setCookieSpec(CookieSpecs.STANDARD).build())
                .build();
        return httpClientBuilder;
    }

the url is composed by the webdav path that is the one described in Documentation
https://(MY_AMAZING_COMPANY)/remote.php/dav/files/(GROUP)/