Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GlsAuthorizer class does not check account type #14

Open
GoogleCodeExporter opened this issue Jul 20, 2015 · 0 comments
Open

GlsAuthorizer class does not check account type #14

GoogleCodeExporter opened this issue Jul 20, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create a Dropbox account on your Android device using the same email address 
as one of your Google accounts.
2. Run the YTD sample app
3. Select the "duplicate" Google/Dropbox account
4. The getAccount method in GlsAuthorizer does not check to determine which 
account is being returned.

What is the expected output? What do you see instead?
getAccount should include an additional check:

private Account getAccount(String name) {
    Account[] accounts = accountManager.getAccounts();
    for (Account account : accounts) {
        if (account.name.equals(name) && account.type.equals("com.google")) {
        return account;
    }
    }
    return null;
}

What version of the product are you using? On what operating system?
* r15 of the ytd-android project

Please provide any additional information below.

As mentioned above, I have two accounts on my device that have the same account 
name, essentially my Gmail address.  One @gmail.com address is tied to my 
Google account and that same email address is the account name for my Dropbox 
account.  So, I have a com.google account type and a com.android.dropbox 
account type.  When the Dropbox account is returned by getAccount, it does not 
have the proper 
authToken for the callback in fetchAuthToken.

A simple fix of checking the account type should resolve this issue.

Original issue reported on code.google.com by parkbsu on 9 Jul 2012 at 7:42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant