簡體   English   中英

從Project Server 2013工作流消費ProjectData-禁止

[英]Consume ProjectData from Project Server 2013 Workflow - Forbidden

我需要使用來自Project Server 2013工作流的http://project/pwa/_api/ProjectData Project OData服務中的數據。 但是我得到了“禁止”響應代碼。 用戶具有所有權限(管理員,網站集管理員)。 即使從其他網站集和服務器場中,也成功使用其他端點(ProjectServer,Web,列表)。 什么時候需要配置安全性以成功使用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);
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM