App-Only
3 TopicsUpdating Editor field on SharePoint Online using the CSOM with App Only Auth
I have the following issue. I work with CSOM and I want to update the Author and Editor field on a List Item object. The actual problem is that the Editor is not updated and the value is set to the SharePoint App user. The problem occurs after using the App Only Authentication. The following method is used to update Author, Editor, Creation Date and Modified Date. List<SP.ListItemFormUpdateValue> values = new List<SP.ListItemFormUpdateValue>(); foreach (ItemProperty property in properties) { property.AddPropertyToUpdateList(ctx, item, info, values); } IList<SP.ListItemFormUpdateValue> results = item.ValidateUpdateListItem(values, true, string.Empty); ctx.ExecuteQuery(); info.Log("<--// Called \'ValidateUpdateListItem\'. //-->"); // check for API-failures. CheckErrors(results); Do you have any ideas why this is not working for Editor but for Author-it works? I also tried to use the Update method to edit the Author and Editor, but this is also not working for the Author field. User user = service.Ctx.Web.EnsureUser("email address removed for privacy reasons"); ctx.Load(user); ctx.ExecuteQuery(); FieldUserValue userValue = new FieldUserValue(); userValue.LookupId =user.Id; item["Editor"] = userValue; item["Author"] = userValue; item.Update(); ctx.ExecuteQuery();4.2KViews0likes3CommentsUnable to retrieve list items with app-only access token via PnP PowerShell
I created an access token and registered it granting fullcontrol to a site collection. In powershell, I connect via the connect-pnponline cmdlet and everything is fine. I can list items in the site collection using, for example: Get-PnPList That appears to successfully return a list of all of the content in the site collection, including lists, libraries, etc. What I cannot do is retrieve any items from within any of the libraries, lists, or even site pages. The output is just blank, with no error returned. If I try query a specific item ID, I get the message that the item does not exist, although it definitely exists, the site is correct and the list name is correct (copy-pasted from the listed items) Here's the permission XML I used to set up access (obviously, with the proper site information) at https://mysharepointdomain.sharepoint.com/sites/my_site/_layouts/15/appinv.aspx: <AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="https://mysharepointdomain.sharepoint.com/sites/my_site/_layouts/15/appinv.aspx" Right="FullControl" /> </AppPermissionRequests> It looks like it might be an access denied issue, but I am not sure what else I am missing, since full control was granted to the site collection. Any suggestions would be appreciated. Thanks.Solved3.8KViews0likes4CommentsSharePoint App Only authentication
Which service handles the authentication for SharePoint app only? Is that service completely different from Azure AD? A custom solution at our org is using Azure AD App with Sites.FullControl.All permission. This AAD App is also given SharePoint App-Only full control rights. We are planning to apply the newly released Workload Identities Conditional Access Policy to restrict the IPs the app can connect from. My question is, will the SharePoint App-Only auth method respect the CAP or that auth method is handled by a different service and as such will remain unsecure.1.1KViews0likes1Comment