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

Step 1: Please open the azure portal in browser https://portal.azure.com/#home

OneDriveClientId-step1-n

Step 2:  Please click the “Azure Active Directory
Step 3:  Once Azure Active Directory open after click the “App Registrations”

OneDriveClientId-step3-n

Step 4:  Then Click the “New registration”

OneDriveClientId-step4-n
Step 5: New App register page open, now register the App.

 OneDriveClientId-step5-2

Step 6: Once register after our app page is open, now click the “API Permissions”

OneDriveClientId-step6-n

Step 7: Now provide the permission for API’s , please refer the below screen shot.

OneDriveClientId-step7

Step 8: Now click the “Certificates and Secrets” and generate the Client Secret Id

OneDriveClientId-step8-n-1

Step 9: Finally Click the “Overview”, once page open after you get the client ID and Tenant Id

OneDriveClientId-step9-n

Step 10: Now you get Client Id and Secret Id and Tenant Id, This Id’s used create the OneDrive sync job in Sync APP