Example #1
0
 public SignInHandler(Looper looper, Activity callingActivity, AuthManager authManager,
                      IAuthListener authListener) : base(looper)
 {
     manager  = authManager;
     activity = callingActivity;
     listener = authListener;
 }
Example #2
0
        /// <summary>
        /// Signs the user out of the application and unenrolls from MAM.
        /// </summary>
        /// <param name="listener"></param>
        public void SignOut(IAuthListener listener)
        {
            // Clear the app's token cache so the user will be prompted to sign in again.
            authContext.TokenCache.Clear();

            string user = User;

            if (user != null)
            {
                // Remove the user's MAM policy from the app
                IMAMEnrollmentManager mgr = MAMComponents.Get <IMAMEnrollmentManager>();
                mgr.UnregisterAccountForMAM(user);
            }

            isAuthenticated = false;

            listener.OnSignedOut();
        }
Example #3
0
        /// <summary>
        /// Signs the user out of the application and unenrolls from MAM.
        /// </summary>
        /// <param name="listener"></param>
        public async void SignOut(IAuthListener listener)
        {
            // Clear the app's token cache so the user will be prompted to sign in again.
            var currentAccounts = await PCA.GetAccountsAsync();

            if (currentAccounts.Count() > 0)
            {
                await PCA.RemoveAsync(currentAccounts.FirstOrDefault());
            }

            string user = User;

            if (user != null)
            {
                // Remove the user's MAM policy from the app
                IMAMEnrollmentManager mgr = MAMComponents.Get <IMAMEnrollmentManager>();
                mgr.UnregisterAccountForMAM(user);
            }

            isAuthenticated = false;

            listener.OnSignedOut();
        }
Example #4
0
		/**
     * Remove the given listener from the list of those that will be notified
     * when authentication events occur.
     * 
     * @param listener
     *            The callback object for notifying the application when auth
     *            events happen.
     */
		public static void RemoveAuthListener (IAuthListener listener)
		{
			mAuthListeners.Remove (listener);
		}
Example #5
0
		/**
     * Associate the given listener with this Facebook object. The listener's
     * callback interface will be invoked when authentication events occur.
     * 
     * @param listener
     *            The callback object for notifying the application when auth
     *            events happen.
     */
		public static void AddAuthListener (IAuthListener listener)
		{
			mAuthListeners.AddLast (listener);
		}
 public bool RemoveAuthListener(IAuthListener authListener)
 {
     return(this._authListeners.TryRemove(authListener.GetHashCode(),
                                          out authListener));
 }
 public void AddAuthListener(IAuthListener authListener)
 {
     this._authListeners[authListener.GetHashCode()] = authListener;
 }
 /**
  * Remove the given listener from the list of those that will be notified
  * when authentication events occur.
  *
  * @param listener
  *            The callback object for notifying the application when auth
  *            events happen.
  */
 public static void RemoveAuthListener(IAuthListener listener)
 {
     mAuthListeners.Remove(listener);
 }
 /**
  * Associate the given listener with this Facebook object. The listener's
  * callback interface will be invoked when authentication events occur.
  *
  * @param listener
  *            The callback object for notifying the application when auth
  *            events happen.
  */
 public static void AddAuthListener(IAuthListener listener)
 {
     mAuthListeners.AddLast(listener);
 }