Example #1
0
        internal static void RegisterProvider(IParseAuthenticationProvider provider)
        {
            authProviders[provider.AuthType] = provider;
            var curUser = ParseUser.CurrentUser;

            if (curUser != null)
            {
                curUser.SynchronizeAuthData(provider);
            }
        }
Example #2
0
        private void SynchronizeAuthData(IParseAuthenticationProvider provider)
        {
            bool restorationSuccess = false;

            lock (mutex) {
                var authData = AuthData;
                if (authData == null || provider == null)
                {
                    return;
                }
                IDictionary <string, object> data;
                if (authData.TryGetValue(provider.AuthType, out data))
                {
                    restorationSuccess = provider.RestoreAuthentication(data);
                }
            }

            if (!restorationSuccess)
            {
                this.UnlinkFromAsync(provider.AuthType, CancellationToken.None);
            }
        }
Example #3
0
 internal static void RegisterProvider(IParseAuthenticationProvider provider) {
   authProviders[provider.AuthType] = provider;
   var curUser = ParseUser.CurrentUser;
   if (curUser != null) {
     curUser.SynchronizeAuthData(provider);
   }
 }
Example #4
0
    private void SynchronizeAuthData(IParseAuthenticationProvider provider) {
      bool restorationSuccess = false;
      lock (mutex) {
        var authData = AuthData;
        if (authData == null || provider == null) {
          return;
        }
        IDictionary<string, object> data;
        if (authData.TryGetValue(provider.AuthType, out data)) {
          restorationSuccess = provider.RestoreAuthentication(data);
        }
      }

      if (!restorationSuccess) {
        this.UnlinkFromAsync(provider.AuthType, CancellationToken.None);
      }
    }