public static Account GetAccount()
        {
            InitEncryption();
            var account = SDK.Auth.AccountManager.GetAccount();

            return(Account.FromJson(SDK.Auth.Account.ToJson(account)));
        }
 public static IAsyncOperation <Account> RefreshAuthToken(Account account)
 {
     return(Task.Run(async() =>
     {
         var response =
             await SDK.Auth.OAuth2.RefreshAuthTokenAsync(account.ConvertToSDKAccount());
         return Account.FromJson(SDK.Auth.Account.ToJson(response));
     }).AsAsyncOperation <Account>());
 }
 public static IAsyncOperation <Account> CreateNewAccount(LoginOptions loginOptions, string response)
 {
     InitEncryption();
     SDK.Auth.AuthResponse authResponse = SDK.Auth.OAuth2.ParseFragment(response);
     return(Task.Run(async() =>
     {
         var account = await SDK.Auth.AccountManager.CreateNewAccount(loginOptions.ConvertToSDKLoginOptions(), authResponse);
         return Account.FromJson(SDK.Auth.Account.ToJson(account));
     }).AsAsyncOperation());
 }
        public static IDictionary <string, Account> GetAccounts()
        {
            InitEncryption();
            Dictionary <string, Account> accounts = new Dictionary <string, Account>();
            var acMgrAccounts = SDK.Auth.AccountManager.GetAccounts();

            foreach (var key in acMgrAccounts.Keys)
            {
                accounts[key] = Account.FromJson(SDK.Auth.Account.ToJson(acMgrAccounts[key]));
            }
            return(accounts);
        }