SharePoint Online get details using impersonation credentials

Naga Sudheer Madduru 6 Reputation points
2020-07-31T06:30:29.133+00:00

Hi,

We have a requirement to create custom form in the SharePoint Modern Page, by providing SharePoint site URL as input and click on submit button, it should get details from SharePoint URL such as Title of site and primary and secondary contact of Owner and display it in the page.

Could you please suggest how to get details from provided input site using impersonation credentials and display, as current user may not have access to that particular site.

Please suggest any other approach available to achieve above functionality.

Regards,
Sudheer

Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

2 answers

Sort by: Most helpful
  1. trevorseward 11,711 Reputation points
    2020-07-31T15:36:10.017+00:00

    The basic architecture would follow this:

    • Create a SharePoint Addin with Tenant FullControl rights. This is required to see all SharePoint Online sites.
    • Store the Client Secret in an Azure KeyVault.
    • Create an Azure Function. This function will be triggered by your web part. You can use the SharePoint Search REST API to find all sites. You will need this solution to connect to the KeyVault previously created to retrieve the secret.
    • On your web part, call the Azure Function.

    I would strongly suggest moving this to a dedicated web application to increase security.

    The ask is not a small ask and will require significant architecture and development knowledge. You can find 3rd party products that can enable this, as well. AvePoint and Metalogix (now Quest) both have apps that help you do this.

    0 comments No comments

  2. MichaelHan-MSFT 18,126 Reputation points
    2020-08-03T09:38:46.667+00:00

    As Trevor said, you need to develop SharePoint add-ins to achieve this. About SharePoint Add-ins, please refer to this artilce: sharepoint-add-ins

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.