Currently I am working on the Graph API with SharePoint. I had gone through the Working with SharePoint sites in Microsoft Graph. In this article there are only limited endpoints to connect with SharePoint and there is only Read-only support for site resources.

My requirement is to create site collection in SharePoint Online using Graph API. Since the graph api is not supported for creation of site in SharePoint Online , Is there any possibility to create SharePoint Context for a specific site using Graph Api Access Token.

Requirement: I had created a ASP.net MVC application using
Cloud - Single Organization Authentication .It was working as expected and my tenant users are able to Login. Now I want to create SharePoint site based on the login user(also having access to SharePoint Online Sites) requirement(Name, title etc..).

How to get the access to the SharePoint Online for the Login user without using ClientId and SecretID.

  • Why cant you create an access token for SharePoint Online? Why must you use a Graph API token? Using an access token to from one service to access another is not possible, since you would use a different resource URI when requesting the access token. Nov 14, 2017 at 18:51
  • @KevinStone Thanks for the reply. I had updated the question with my requirement for more under standing. please check once.
    – TARUN
    Nov 15, 2017 at 4:49
  • Why can't you store a client secret value in your web.config? When you create a your application in Visual Studio as the article suggests, it auto-creates an application in Azure AD. You then update the app permissions with delegated access to SharePoint Online. Then, authorize the app with a tenant admin account. In your code, you would request an access token for SharePoint using your client ID, client secret, and SharePoint online resource URI. Then, you create a SP ClientContext object and the token to the headers of the WebRequestExecutor.WebRequest.Headers.Add method. Nov 15, 2017 at 15:14
  • Can you please provide any sample code if available
    – TARUN
    Nov 17, 2017 at 4:39


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.