I'm using the PnP framework and want to do a app-only authentication against the mytenant-admin.sharepoint.com site so I can create sitecollection but I dont know how to give the app rights to the admin site.

In normal cases I'm going to the page _/layouts/15/appinv.aspx to give app-permission rights but that does not work from admin site.

How am I supposed to do?


You can register your app only principal using your regular root site collection https://mytenant.sharepoint.com/_layouts/15/appregnew.aspx and appinv.aspx (you don't need to do this on the mytenant-admin site)

You will need to have tenant admin rights, and use the following permissions xml in appinv.aspx

<AppPermissionRequests AllowAppOnlyPolicy="true">
    <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" />

However in your app code, when you get your app-only access token and client context, you need to use the mytenant-admin.sharepoint.com site url.

  • Cool. Thanks a lot this really solved my problems. – Magnus Jansson Mar 20 '16 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.