1

Project Online を使用して、MS Project Server 2013 で SharePoint 2013 をホストしています。Restful Jersey クライアントからhttps://my_company.sharepoint.com/sites/pwa/_api/ProjectData/Projectsにアクセスしようとすると、適切な資格情報を提供した後、私はステータス タイプ 403 の応答を取得します。応答のテキスト本文に対応する文字列は、次の xml です。

<?xml version="1.0" encoding="UTF-8"?>  
    <m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
        <m:code>-2147024891, System.UnauthorizedAccessException</m:code>
        <m:message xml:lang="en-US">Access denied. You do not have permission to perform this action or access this resource.</m:message>
    </m:error>

Rest API を認証してアクセスするために使用しているコードは次のとおりです。

String url = "https://myCompany.sharepoint.com/sites/pwa/_api/ProjectData/Projects";
try {
    Client client = Client.create();
    client.addFilter(new HTTPBasicAuthFilter(username, pass));
    WebResource webResource = client.resource(url); 
    ClientResponse response = (ClientResponse)webResource.type(MediaType.APPLICATION_ATOM_XML).get(ClientResponse.class);
    InputStream inputStream = response.getEntityInputStream();

    try {
        String output = IOUtils.toString(inputStream);
        System.out.println("output: "+output); 
    } catch(IOException e) {
        e.printStackTrace();
    }
} catch (Exception e) {
    e.printStackTrace();
}

この問題は、Project Online が使用する https プロトコルに何らかの形で関連していると思いますが、よくわかりません。どんな助けでも大歓迎です。

4

1 に答える 1

2

2 つのこと: 1- Project Online を使用している場合は、基本認証なしの OAuth を使用します。 2- ユーザーは、" Access Project Server Reporting Service " 権限が有効になっているグループに属している必要があります。

于 2015-04-23T21:26:08.747 に答える