我需要使用来自Project Server 2013 Workflow的http://project/pwa/_api/ProjectData
Project OData服务的数据。但我有"禁止"响应码。用户具有所有权限(管理员、局点管理员)。成功地使用其他端点(ProjectServer、Web、Lists),甚至来自其他站点集合和农场。当我需要配置安全以成功使用ProjectData时?谢谢你!
是否尝试提供凭据
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
using Microsoft.SharePoint.Client;
using Microsoft.ProjectServer.Client;
static void Main(string[] args)
{
const string pwaPath = "http://ServerName/pwa/";
const string password = "pwa_password";
const string userName = "user_name@your_company.onmicrosoft.com";
var projContext = new ProjectContext(pwaPath);
var secureString = new SecureString();
password.ToCharArray().ToList().ForEach(x => secureString.AppendChar(x));
projContext.Credentials = new SharePointOnlineCredentials(userName, secureString);
// Get the list of published projects in Project Web App.
projContext.Load(projContext.Projects);
projContext.ExecuteQuery();
Console.WriteLine("nThere are {0} projects", projContext.Projects);
}