sharepoint-onlinesharepoint-2016sharepoint-object-model

SharePoint Online UserInfo endpoint URL


I am trying to build SharePoint Online Adapter using Microsoft.SharePointOnline.CSOM version 16.1.7018.1200

I am struggling in finding for this REST API the correct Endpoint URLs. Some of them might be same as in GDrive (since both of them are using OAuth2), but still I am a bit confused. My questions is about: - Scope, LoginBaseUrl, AccessTokenBaseUrl and UserInfoEndpointUrl

As an example in GDrive situation was:

Scope = "https://www.googleapis.com/auth/drive.file";

LoginBaseUrl = "https://accounts.google.com/o/oauth2/auth";
AdditionalLoginParameters.Add("response_type", "code");

AccessTokenBaseUrl = "https://accounts.google.com/o/oauth2/token";
AdditionalAccessTokenParameters.Add("grant_type", "authorization_code");

UserInfoEndpointUrl = "https://www.googleapis.com/drive/v3/about?fields=user&access_token=" + accessToken;

PS: If anyone have some documentation or code samples it will be much appriciated! So far I was able to find code samples only for Read operations.

If any additional information is required please let me know.

Best regards, SVG


Solution

  • If you're talking about the user info endpoint from an auth perspective, Azure Active Directory is actually handling most of the authentication and some of the authorization for SharePoint online. Things are currently a little bit complicated with the :

    However the v2 configuration endpoint will provide the user_info endpoint documentation

    If you want to read the SharePoint user profile here is the documentation for the REST API, CSOM provides you some more capabilities.

    However if you don't have requirements mapping to reading specifically from SharePoint, I'd recommend instead using the Graph user endpoint. Documentation