public final class ProjectServerCredentials extends Object
Credentials which are used to connect to Project Online.
Constructor and Description |
---|
ProjectServerCredentials(String siteUrl,
String authToken)
Initializes a new instance of the
ProjectServerCredentials class. |
Modifier and Type | Method and Description |
---|---|
String |
getAuthToken()
Gets the authorization token for the SharePoint.
|
String |
getSiteUrl()
Gets the URL of the sharepoint site.
|
public ProjectServerCredentials(String siteUrl, String authToken)
Initializes a new instance of the ProjectServerCredentials
class.
siteUrl
- The url of sharepoint site. For example, https://your_company_name.sharepoint.com"authToken
- Gets the authorization token for sharepoint. See AuthToken
(getAuthToken()
/setAuthToken(String)
) property description.public final String getAuthToken()
Gets the authorization token for the SharePoint. Can be retrieved using SharePointOnlineCredentials class from Microsoft.SharePoint.Client.Runtime assembly (in Microsoft.SharePoint.Client.Runtime.dll).
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); if (fedAuthTicket.StartsWith("SPOIDCRL=")) { fedAuthTicket = fedAuthTicket.Substring(9, fedAuthTicket.Length - 9); } var projectOnlineCredentials = new ProjectServerCredentials(siteUrl.ToString(), fedAuthTicket);
public final String getSiteUrl()
Gets the URL of the sharepoint site. For example, https://your_company_name.sharepoint.com";
Copyright (c) 2008-2019 Aspose Pty Ltd. All Rights Reserved.