Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharepoint CSOM Authentication issue with .NET Core

I'm new to Sharepoint online, and don't have an own account (yet), just an username/password from a client.

Need to build a service that gets the folder structure and archives from Sharepoint. And then allows to up/download archives.

Since the package

Microsoft.SharePointOnline.CSOM

is not compatible with .NET Core, I'm using this github solution that seems to cover the main functionality in an equal way: https://github.com/OneBitSoftware/NetCore.CSOM

I think there is nothing wrong with that so far - but when trying to connect using

SharePointOnlineCredentials

...I'm getting the error

PPCRL_REQUEST_E_PARTNER_HAS_NO_ASYMMETRIC_KEY

So I guess there's some account setting missing on the server side? Or am I following a wrong approach? I would have no problem implementing an OAuth access to get a Bearer token, but which API would that be, and how can I register an app for Sharepoint?

My research about API's and this particular error didn't result in anything yet, so I'm reaching out for help here.

like image 506
Stefan R. Avatar asked Apr 12 '18 18:04

Stefan R.


1 Answers

Get NuGet package TTCUE.NetCore.SharepointOnline.CSOM.16.1.8029.1200. You can also download an official package Microsoft.SharePointOnline.CSOM but it will attach wrong dlls to your project and you would need to change them according to the link from a different answer here - https://rajujoseph.com/getting-net-core-and-sharepoint-csom-play-nice/

Note - Your .NET Core project will compile, but it doesn't mean that it will work on, for example, linux. Those CSOM dlls are not finished and Microsoft is still working on them.(for a loooong time...)

like image 94
Adrian Stanisławski Avatar answered Sep 20 '22 20:09

Adrian Stanisławski