I'm looking for a way to publish files to my users. The business case is for instance the publishing of salary slips from a third party application. You would want to place these documents in a secure and foremost personal location: OneDrive seems to be a likely candidate for that.
So I went out to see whether it's possible to somehow push files into the OneDrive folder of a user, but this does not seem to be the case. All of the samples I found directly user the "current user" as an endpoint, never someone else.
What we also do not want of course is to have access to all of the files a user stores in their OneDrive location. This is about pushing files to them, not reading anything that is already in there.
I found these articles, but those do not answer the question; How to upload List Template to user's OneDrive using powershell? Access user's OneDrive data using REST API
The only solution I could think of is that the users creates a folder themselves, shares it with a service account so that we can use that service account to send files to this location. Can be done with the right steps, but heavily depends on the user in this case.
Another possible solution would be to create a library or folder somewhere per user, with permissions for only that specific user and publish the files there. Almost what we want, but preferably everything should be in OneDrive.
So I was wondering whether anyone has ever faced similar requirements and might have thought of some other solution?