Skip to content

Commit add86cd

Browse files
authored
Improved content about app-only context (SharePoint#5546)
1 parent bbabb7e commit add86cd

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

docs/solution-guidance/Bulk-user-profile-update-api-for-sharepoint-online.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Bulk update custom user profile properties for SharePoint Online
33
description: To replicate custom attributes to the SharePoint user profile service, use the UserProfile.BatchUpdate.API.
4-
ms.date: 5/8/2018
4+
ms.date: 4/3/2020
55
localization_priority: Priority
66
---
77

@@ -400,7 +400,18 @@ _DataFileNotJson - JsonToken EndObject is not valid for closing JsonType Array.
400400

401401
### Can I execute the code using app-only/add-in only permissions?
402402

403-
Yes, you need to register the client ID and secret to be able to execute the APIs. Because the actual import of the file does not occur synchronously with the identity of the caller, this works without any issues.
403+
Yes, the actual import of the file does not occur synchronously with the identity of the caller, so this works with app-only context without any issues.
404+
405+
In order to use an app-only context with the SharePoint add-in model, you need to register a client ID and secret to be able to execute the APIs following [this guidance](https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs). Moreover, while registering the SharePoint add-in you will have to grant the permissions using the following XML snippet:
406+
407+
```xml
408+
<AppPermissionRequests AllowAppOnlyPolicy="true">
409+
<AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" />
410+
<AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="FullControl" />
411+
</AppPermissionRequests>
412+
```
413+
414+
In order to use app-only with an application registered in Azure Active Directory, you need to [register the application](https://docs.microsoft.com/en-us/graph/auth-register-app-v2), [provide a X.509 certificate for authentication](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-certificate-credentials#register-your-certificate-with-microsoft-identity-platform), which is a requirement for SharePoint Online app-only authentication within Azure Active Directory, and grant the following SharePoint Online permissions scopes for Application: Sites.FullControl.All and User.ReadWrite.All .
404415

405416
### This API is updating properties in the user profile service, but how would I create those properties in the tenant?
406417

@@ -420,7 +431,7 @@ No, this is not currently supported with this API.
420431

421432
### What permissions are required for executing this API?
422433

423-
You must have Global Admin permissions currently. SharePoint Admin is not sufficient.
434+
You must have Global Admin permissions currently, unless you use an app-only authentication context. SharePoint Admin is not sufficient.
424435

425436
### Can I import taxonomy based properties?
426437

0 commit comments

Comments
 (0)