Anyone with experience with this API? I did some searching through the
google code docs, and code search with not much luck for what I'm
looking to do. I want to provide an alternate authentication mechanism
for my app in case the user forgets the password they set using one of
the registered gmail addresses as follows:

AccountManager actMgr =
(AccountManager)getSystemService(Context.ACCOUNT_SERVICE);
Account[] accounts = actMgr.getAccountsByType("com.google");

Account userAcct = null;
Bundle result = null;

for (Account act : accounts)
{
 if (txt.getText().toString().equals(act.name))
 {
  userAcct = act;
  break;
 }
}

if (null != userAcct)
{
 try
 {
  // submit off the account to verify the credentials
  AccountManagerFuture<Bundle> bundle =
actMgr.confirmCredentials(userAcct,
                                                               null, // what 
should go here for
options?
                                                       AccountHandler.this,
                                                       null,
                                                       null);

  result = bundle.getResult();
 }
 catch (Exception e)
 {
  Log.d(s_Namespace, "Failed to submit credentials!");
 }
}

According to the docs the returned bundle should contain either a
KEY_INTENT, or KEY_ACCOUNT_TYPE/KEY_ACCOUNT_NAME. The bundle returned
contains nothing and there is no error from the logcat. Any help would
be appreciated, and if anyone has suggestions for alternate ways to
authenticate that would be great.

I'm trying to avoid at all cost taking in the user's password,
otherwise I could just submit that as an option, as I dont want to add
onto the plague of "un" trusted 3rd party apps.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to