WebDavClient
WebDavClient copied to clipboard
MSAL claims based authentication not supported
In the web client params, we should be able to pass an AuthenticationHeaderValue to support MSAL, for example the following from the Microsoft MSAL tutorial
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(Constants.BearerAuthorizationScheme,
accessToken);
Currently this Web DAV Client does not support Microsoft sharepoint since I can't pass the needed access token as part of the header. I might add this in myself if it would be desired.
Hi @serp777 ,
It's possible to pass a custom HttpClient
instance when creating WebDavClient
.
WebDavClient CreateClientWithAuth(string accessToken)
{
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", accessToken);
return new WebDavClient(httpClient);
}
I hope it solves it.