public async Task Login(LoginUserResponse accessToken)
        {
            _refreshToken = accessToken.RefreshToken;
            _accessToken  = accessToken.AccessToken;
            await _secureBlobCache.InsertObject(AccessTokenKey, accessToken.AccessToken);

            await _secureBlobCache.InsertObject(RefreshTokenKey, accessToken.RefreshToken);

            await _localMachineCache.InsertObject(IsNewUserKey, false);

            IsNewUser   = false;
            AccessToken = accessToken.AccessToken;
        }
Beispiel #2
0
 /// <summary>
 /// Save a user/password combination in a secure blob cache. Note that
 /// this method only allows exactly *one* user/pass combo to be saved,
 /// calling this more than once will overwrite the previous entry.
 /// </summary>
 /// <param name="blobCache">The blob cache where to store the data.</param>
 /// <param name="user">The user name to save.</param>
 /// <param name="password">The associated password.</param>
 /// <param name="host">The host to associate with the data.</param>
 /// <param name="absoluteExpiration">An optional expiration date.</param>
 /// <returns>A observable which signals when the insert is completed.</returns>
 public static IObservable <Unit> SaveLogin(this ISecureBlobCache blobCache, string user, string password, string host = "default", DateTimeOffset?absoluteExpiration = null)
 {
     return(blobCache.InsertObject("login:" + host, new Tuple <string, string>(user, password), absoluteExpiration));
 }
 /// <summary>
 /// Save a user/password combination in a secure blob cache. Note that
 /// this method only allows exactly *one* user/pass combo to be saved,
 /// calling this more than once will overwrite the previous entry.
 /// </summary>
 /// <param name="user">The user name to save.</param>
 /// <param name="password">The associated password</param>
 /// <param name="absoluteExpiration">An optional expiration date.</param>
 public static void SaveLogin(this ISecureBlobCache This, string user, string password, string host = "default", DateTimeOffset?absoluteExpiration = null)
 {
     This.InsertObject("login:" + host, new Tuple <string, string>(user, password), absoluteExpiration);
 }