Aspose.Tasks for C++
Aspose::Tasks::ProjectServerCredentials Class Referencefinal

Credentials which are used to connect to Project Online or on-premise instance of Project Server. More...

#include <ProjectServerCredentials.h>

Inherits System::Object.

Public Member Functions

System::String get_SiteUrl () const
 Gets the URL of PWA at SharePoint site or URL of on-premise Project Server. For example, https://your_company_name.sharepoint.com/sites/pwa"; More...
 
System::String get_AuthToken () const
 Gets the authorization token for the SharePoint instance. More...
 
System::String get_UserName () const
 Gets the user name for SharePoint site. More...
 
 ProjectServerCredentials (const System::String &siteUrl, const System::String &authToken)
 Initializes a new instance of the ProjectServerCredentials class using URL of SharePoint site and valid SPOIDCRL authorization token for SharePoint's PWA (Project Web Access) site. More...
 
 ProjectServerCredentials (const System::String &siteUrl, const System::String &userName, const System::String &password)
 Initializes a new instance of the ProjectServerCredentials class using URL of SharePoint site, user name and password. More...
 
 ProjectServerCredentials (const System::String &siteUrl, const System::SharedPtr< System::Net::NetworkCredential > &credentials)
 Initializes a new instance of the ProjectServerCredentials class using URL of Project Web Access endpoint and network credentials. More...
 
System::String ToString () const override
 Returns a string representation of this instance. More...
 

Detailed Description

Credentials which are used to connect to Project Online or on-premise instance of Project Server.

Constructor & Destructor Documentation

◆ ProjectServerCredentials() [1/3]

Aspose::Tasks::ProjectServerCredentials::ProjectServerCredentials ( const System::String &  siteUrl,
const System::String &  authToken 
)

Initializes a new instance of the ProjectServerCredentials class using URL of SharePoint site and valid SPOIDCRL authorization token for SharePoint's PWA (Project Web Access) site.

Parameters
siteUrlThe URL of PWA (Project Web Access) API of Project Online.
authTokenThe authorization token (SPOIDCRL) for SharePoint's PWA (Project Web Access) site.

Use this constructor to connect to ProjectOnline when you already have AuthToken for your SharePoint Online site.

◆ ProjectServerCredentials() [2/3]

Aspose::Tasks::ProjectServerCredentials::ProjectServerCredentials ( const System::String &  siteUrl,
const System::String &  userName,
const System::String &  password 
)

Initializes a new instance of the ProjectServerCredentials class using URL of SharePoint site, user name and password.

Parameters
siteUrlThe URL of PWA (Project Web Access) API of Project Online.
userNameThe user name for the SharePoint site.
passwordThe password for the SharePoint site.

Use this constructor to connect to ProjectOnline. Please note that legacy authentication should be enabled in your Azure portal and Office 365 Admin center.

◆ ProjectServerCredentials() [3/3]

Aspose::Tasks::ProjectServerCredentials::ProjectServerCredentials ( const System::String &  siteUrl,
const System::SharedPtr< System::Net::NetworkCredential > &  credentials 
)

Initializes a new instance of the ProjectServerCredentials class using URL of Project Web Access endpoint and network credentials.

Parameters
siteUrlThe URL of project web access endpoint.
credentialsThe credentials used to login to Project Web Access endpoint.

Use this constructor to connect to on-premise instance of Project Server via PWA.

In this example the instance of ProjectServerManager class is used to read a list of project from Project Server instance located at http://project_server_instance.local

string site = "http://project_server_instance.local/sites/pwa";
var windowsCredentials = new NetworkCredential("Administrator", "my_password", "DOMAIN");
var projectServerCredentials = new ProjectServerCredentials(site, windowsCredentials);
ProjectServerManager manager = new ProjectServerManager(projectServerCredentials);
var list = manager.GetProjectList();
foreach (var projectInfo in list)
{
Console.WriteLine("{0} - {1} - {2}", projectInfo.Id, projectInfo.CreatedDate, projectInfo.Name);
}
ProjectServerCredentials(const System::String &siteUrl, const System::String &authToken)
Initializes a new instance of the ProjectServerCredentials class using URL of SharePoint site and val...

Member Function Documentation

◆ get_AuthToken()

System::String Aspose::Tasks::ProjectServerCredentials::get_AuthToken ( ) const

Gets the authorization token for the SharePoint instance.

◆ get_SiteUrl()

System::String Aspose::Tasks::ProjectServerCredentials::get_SiteUrl ( ) const

Gets the URL of PWA at SharePoint site or URL of on-premise Project Server. For example, https://your_company_name.sharepoint.com/sites/pwa";

◆ get_UserName()

System::String Aspose::Tasks::ProjectServerCredentials::get_UserName ( ) const

Gets the user name for SharePoint site.

◆ ToString()

System::String Aspose::Tasks::ProjectServerCredentials::ToString ( ) const
override

Returns a string representation of this instance.

Returns
a string representation of this instance.