0

I want to get tenant CorporateCatalogUrl using CSOM . I tried following code & didn't work . I am also not sure that is the correct way.Is there way to get CorporateCatalogUrl using CSOM ?

using (ClientContext context = new ClientContext("https://abc-admin.sharepoint.com"))
                {
                    context.ExecutingWebRequest += delegate (object sender, WebRequestEventArgs e)
                    {
                        e.WebRequestExecutor.WebRequest.Headers.Add("Authorization", "Bearer " + AccessToken);
                    }; 
           
                    var TenantSettings = Microsoft.SharePoint.Client.TenantSettings.GetCurrent(context);                       
                    context.Load(TenantSettings);
                    context.ExecuteQueryRetry();   
                }
DevÁsith
  • 1,072
  • 12
  • 38

1 Answers1

0

I use SharePointOnlineCredentials(name, securePassword); for authentication, and I could get the tenant CorporateCatalogUrl as the below picture. If you are using access token, please make sure you have grant necessary permissions.

enter image description here

Michael Han
  • 3,475
  • 1
  • 6
  • 8