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 using url of sharepoint site and valid
authorization token for sharepoint site. |
ProjectServerCredentials(String siteUrl,
String userName,
String password)
Initializes a new instance of the
ProjectServerCredentials class using url of sharepoint site, user name
and password. |
Modifier and Type | Method and Description |
---|---|
String |
getAuthToken()
Gets the authorization token for the SharePoint.
|
String |
getSiteUrl()
Gets the URL of the sharepoint site.
|
String |
getUserName()
Gets the user name for sharepoint site
|
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.
siteUrl
- The url of sharepoint site. For example, https://your_company_name.sharepoint.com"authToken
- The authorization token for sharepoint. See AuthToken
(getAuthToken()
/setAuthToken(String)
) property description.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.
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.public final String getAuthToken()
Gets the authorization token for the SharePoint. Can be retrieved using SharePointOnlineCredentials class from Microsoft.SharePoint.Client.Runtime assembly.
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);
public final String getSiteUrl()
Gets the URL of the sharepoint site. For example, https://your_company_name.sharepoint.com";
public final String getUserName()
Gets the user name for sharepoint site