An API that connects multiple Microsoft services, enabling data access and automation across platforms
Figured this out on my own, figured I'd post the information here for anyone who finds this link later.
What I needed to do was set up sharepoint as a "downstream api" when initializing the authentication and token cache:
builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(builder.Configuration, "AzureAd")
.EnableTokenAcquisitionToCallDownstreamApi(new string[] { "sites.read.all",
"ListItems.SelectedOperations.Selected",
"Lists.SelectedOperations.Selected",
"User.Read"})
.AddDownstreamApi("Sharepoint", builder.Configuration.GetSection("SharepointAPI.Scopes"))
.AddMicrosoftGraph(graphBaseUrl: "https://graph.microsoft.us/v1.0/")
.AddInMemoryTokenCaches();
and then retrieve the token for that endpoint from the token cache with:
_tokenAcquisition.GetAccessTokenForUserAsync(new List<string> { "https://{sharepointURL}/.default" });
This let me directly access the token and set it in my API calls to the sharepoint v1 API.