GetCredentials() public method

Gets the last used credentials.
public GetCredentials ( ) : String[]
return String[]
Example #1
0
 /// <summary>
 /// Logins to the server by using the last used credentials.(If the user choosed to save them).
 /// </summary>
 /// <returns></returns>
 private bool AutoLogin()
 {
     LoginData loginData = new LoginData(LoginData.XWORD_LOGIN_DATA_FILENAME);
     bool canAutoLogin = loginData.CanAutoLogin();
     if (canAutoLogin)
     {
         String[] credentials = loginData.GetCredentials();
         serverURL = credentials[0];
         username = credentials[1];
         password = credentials[2];
         Client = XWikiClientFactory.CreateXWikiClient(ClientType, serverURL, username, password);
     }
     return canAutoLogin;
 }
Example #2
0
 /// <summary>
 ///  Loads the last used credentials of the user.
 /// </summary>
 /// <returns>TRUE if the user has stored credentials can be performed. FALSE otherwise.</returns>
 private bool LoadCredentials()
 {
     LoginData loginData = new LoginData(LoginData.XWORD_LOGIN_DATA_FILENAME);
     bool hasCredentials = loginData.HasCredentials();
     if (hasCredentials)
     {
         rememberCredentials = true;
         String[] credentials = loginData.GetCredentials();
         serverURL = credentials[0];
         username = credentials[1];
         password = credentials[2];
     }
     else
     {
         rememberCredentials = false;
     }
     return hasCredentials;
 }