User Guide – Generate Client Id and Secret Id

App-Only is a model for setting up app principals. It can be used with SharePoint Online, as will SharePoint on-premises (SharePoint 2013 and above versions).

Steps:

  1. Navigate to SharePoint site (e.g., https://tenant.sharepoint.com)
  2. Open appregnew.aspx page (https://tenant.sharepoint.com/_layouts/15/appregnew.aspx).
    Example:
    Online – https://m365x634254.sharepoint.com/_layouts/15/appregnew.aspx
    On Premises – http://klstsp16:2016/_layouts/15/ appregnew.aspxGenerate Client Id and Secret Id User Guide-image-1
  3. Click “Generate” button against Client Id row to generate a new client id.
  4. Click “Generate” button against Client secret row to generate a new client secret.
  5. Type any Title, which describes your app principal.
  6. Type App domain as www.localhost.com
  7. Specify redirect URI as https://www.localhost.com.
    Generate Client Id and Secret Id User Guide-2
  8. Click Create.
  9. Note down the Client Id and Client Secret for future references.
    Generate Client Id and Secret Id User Guide-3

Steps:

  1. Open SharePoint Tenant site with Tenant Administrator account (https://tenantname.sharepoint.com/_layouts/15/appinv.aspx, https://tenantname-admin.sharepoint.com/_layouts/15/appinv.aspx)
    Example:
    Online – https://m365x634254.sharepoint.com/_layouts/15/appinv.aspx
    On Premises – http://klstsp16:2016/_layouts/15/ appinv.aspxGenerate Client Id and Secret Id User Guide-4
  2. In the App Id textbox type your generated Client Id
  3. Click the Lookup buttonGenerate Client Id and Secret Id User Guide-5
  4. In the Permission Request XML textbox type below xml,
    <AppPermissionRequests AllowAppOnlyPolicy=”true”>
    <AppPermissionRequest Scope=”http://sharepoint/content/tenant” Right=”FullControl”/> </AppPermissionRequests>
    Generate Client Id and Secret Id User Guide-6
  5. Click Create button
  6. In the next dialog click Trust It button.Generate Client Id and Secret Id User Guide-7