Impersonation allows a site admin access to all the folders on the platform, including those that belong to other users. With DataHub, a job can be setup using the username and password of the site admin to sync / migrate / copy files to or from a different user's account without ever having the username or password of that user.
In this scenario, files are being copied from an NFS location to the OneDrive for Business account of Joe Developer by the site administrator
Create an NFS connection to be used as the source
post
|
body
|
- Create a OneDrive for Business connection as the site administrator to be used as the destination
-
Create a new transfer job with the impersonate_as section in the body
post
|
body
|
Important Note
Files which you see when you login as jdeveloper are inside default ‘Documents’ library, so if you want transfer to create subfolder accessible via their UI you can set destination as “/Documents/{{New_Folder_Name}}”
If you set your destination path to just /{{New_Folder_Name}} it will successfully transfer but will not be readily visible to the user you are impersonating. At this time, not exactly sure where jdeveloper would find it other than modifying the URL
- For example, https://domainName-my.sharepoint.com/personal/jdeveloper_domainName_onmicrosoft_com/{New_Folder_Name}
Info
For platforms which use Active Directory accounts (such as SharePoint on-premise), specify the following instead of "email" in the "impersonate_as" block:
"username": "domain\user"
-
Run the transfer job and notice that the source files have been copied to Joe Developer's OneDrive for Business account into the specified path
patch
|