We have an asp.net MVC application where users connect through azure active directory. They can manage files through their sharepoint online accounts.
To access sharepoint online, we use CSOM.We want the user connected to azure active directory use his account to manipulate files without fill credentials. To do that we attach an access token to the request's header to be authenticated. It works fine.
Now we want to use excel services SOAP API in sharepoint online. To be authenticated we must fill credentials. How can we bypass it and be authenticated with the user logged ?
EDIT : You can see below the code to access sharepoint resources with the current user context.
using (ClientContext context = new ClientContext("https://myServer.sharepoint.com"))
{
context.ExecutingWebRequest += ExecutingWebRequest;
context.Load(context.Web.Lists);
context.ExecuteQuery();
// Do some stuff with lists ...
}
private void ExecutingWebRequest(object sender, WebRequestEventArgs e)
{
e.WebRequestExecutor.WebRequest.Headers.Add("Authorization", "Bearer " + accessToken);
}
I need to do something like this to access excel services webservices with the current user context.