com.aspose.tasks

Interfaces

Classes

Exceptions

com.aspose.tasks

Class ProjectServerCredentials



  • public final class ProjectServerCredentials
    extends Object

    Credentials which are used to connect to Project Online.

    • Constructor Detail

      • ProjectServerCredentials

        public ProjectServerCredentials(String siteUrl,
                                        String authToken)

        Initializes a new instance of the ProjectServerCredentials class using url of SharePoint site and valid authorization token for SharePoint site.


         In this example auth token is retrieved using SharePointOnlineCredentials class from Microsoft.SharePoint.Client.Runtime assembly.
         
         [C#]
         Uri siteUrl = new Uri("https://your_company_name.sharepoint.com");
         var username = "your.login@nstincorporated.onmicrosoft.com";
         SecureString password = new SecureString();
         var pwdS = "your_password";
         foreach (char c in pwdS)
         {
             password.AppendChar(c);
         }
         var onlineCredentials = new SharePointOnlineCredentials(username, password);
         var fedAuthTicket = onlineCredentials.GetAuthenticationCookie(siteUrl, true);
         var projectOnlineCredentials = new ProjectServerCredentials(siteUrl.ToString(), fedAuthTicket);
         
        Parameters:
        siteUrl - The url of SharePoint site. For example, https://your_company_name.sharepoint.com"
        authToken - The authorization token for SharePoint site.


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

        public ProjectServerCredentials(String siteUrl,
                                        String userName,
                                        String password)

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

        Parameters:
        siteUrl - The url of SharePoint site. For example, https://your_company_name.sharepoint.com"
        userName - The user name for the SharePoint site.
        password - The password for the SharePoint site.


        Use this constructor to connect to ProjectOnline.
    • Method Detail

      • getAuthToken

        public final String getAuthToken()

        Gets the authorization token for the SharePoint instance.

        Returns:
        the authorization token for the SharePoint instance.
      • getSiteUrl

        public final String getSiteUrl()

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

        Returns:
        the URL of the SharePoint site or URL of on-premise Project Server.
      • getUserName

        public final String getUserName()

        Gets the user name for SharePoint site.

        Returns:
        the user name for SharePoint site.