I want create a webpart to display information from Project Server 2013. So that I can implement my webpart on a new page on Project Server.
My approache is to create a SharePoint 2013 Webpart and use Microsoft.ProjectServer.Client.dll
private void GetProjectsListData()
{
context = new ClientContext(pwaPath);
projSvr = new ProjectServer(context);
context.Load(projSvr.Projects);
context.ExecuteQuery();
gdvProjectsList.DataSource = projSvr.Projects;
gdvProjectsList.DataBind();
}
But I get an 401 Authentication error. I think the SP use the IIS application pool user and not my user. If I use the CSOM in a console application it is working.
Is this the correct approach to do this or should I use the PSI? Or how can i impersionate to tell the CSOM to use another user?