public static bool Authorize(string username, string password, out UserInfo userInfo) { var rval = false; userInfo = null; lock (m_mutex) { var internalClient = new InternalClient(Configuration, 0, username, password, false); try { userInfo = internalClient.GetItem <UserInfo>("/userinfo", null); if (userInfo != null) { rval = true; var auth = new TrueDialogAuthElement { AccountId = userInfo.AccountId, ApiKey = userInfo.ApiKey.Key, ApiSecret = userInfo.ApiKey.Secret, UserName = username, Password = password }; m_client = new TrueDialogClient(new InternalClient(Configuration, auth)); } } catch (System.Exception) { // just ignore } } return(rval); }
public TrueDialogClient AsAccount(int accountId) { InternalClient.AsAccount(accountId); return(this); }
public void SetAccountId(int accountId) { InternalClient.SetAccountId(accountId); }
public TrueDialogClient(int accountId, string username, string password) { InternalClient = new InternalClient(null, accountId, username, password); }
public TrueDialogClient(int accountId) { InternalClient = new InternalClient(null, accountId); }
internal TrueDialogClient(InternalClient internalClient) { InternalClient = internalClient; }
public TrueDialogClient() { InternalClient = new InternalClient(); }