accountmanager

Twitter Authentication through Android's AccountManager classes

只谈情不闲聊 提交于 2019-12-01 16:50:44
I am developing an android application and want to integrate Twitter. What I understand is if on user's device, official android Twitter app is installed then we can authenticate using account manager as mentined here .. and if not installed then show twitter login web page. Is my understanding correct? Now authenticating using twitter web login page is working fine. But how do I login using account manager? Using AccountsType as "com.twitter.android.auth.login" I got token and token secret using account manager from •com.twitter.android.oauth.token •com.twitter.android.oauth.token.secret I am

What features are supported by Android's Google accounts authenticator?

天涯浪子 提交于 2019-12-01 16:20:13
The API documentation for the hasFeatures method of Android's AccountManager has the following to say about which features are supported by each authenticator: Account features are authenticator-specific string tokens identifying boolean account properties. For example, features are used to tell whether Google accounts have a particular service (such as Google Calendar or Google Talk) enabled. The feature names and their meanings are published somewhere associated with the authenticator in question. Does anybody have any idea where "somewhere associated with the authenticator in question"

addAccountExplicitly throws IllegalStateException caused by Securityexception

放肆的年华 提交于 2019-12-01 09:17:47
Using this code throws that exception and doesn't add created account into account manager. AccountManager am = AccountManager.get(activity); Account acc = new Account(name,activity.getString(R.string.account_type)); am.addAccountExplicitly(acc,"Password",null); I have followed this - http://developer.android.com/training/id-auth/custom_auth.html Any idea why it is caused? //edit: Caused by: java.lang.SecurityException: caller uid 10035 is different than the authenticator's uid have you tried setting permissions in the manifest, i suspect you may need this? <uses-permission android:name=

addAccountExplicitly throws IllegalStateException caused by Securityexception

左心房为你撑大大i 提交于 2019-12-01 06:59:03
问题 Using this code throws that exception and doesn't add created account into account manager. AccountManager am = AccountManager.get(activity); Account acc = new Account(name,activity.getString(R.string.account_type)); am.addAccountExplicitly(acc,"Password",null); I have followed this - http://developer.android.com/training/id-auth/custom_auth.html Any idea why it is caused? //edit: Caused by: java.lang.SecurityException: caller uid 10035 is different than the authenticator's uid 回答1: have you

Asynchronous account authentication with Volley

狂风中的少年 提交于 2019-12-01 06:36:27
everybody. I'm implementing an account authenticator using AbstractAccountAuthenticator and I need call an asynchronous method in the function getAuthToken, to authenticate a user. My code is like this: public class AccountAuthenticator extends AbstractAccountAuthenticator { ... @Override public Bundle getAuthToken( final AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options ) throws NetworkErrorException { final AccountManager accountManager = AccountManager.get(context); String authToken = accountManager.peekAuthToken( account, authTokenType ); // !!!!

validating Android's authToken on third party server

馋奶兔 提交于 2019-11-30 19:22:05
I'm writing an Android application, which uses AccountManager to get the token. From an android app I'm able to interact with Google Picasa - it works fine. What I would like to achieve is the following: send some text + authToken to my third party server, then check if the token is correct before saving the text. Now the question is: is it possible to determine if the authToken of a particular token is correct solely on the token itself (and maybe email address). I've already programmed the server part, which accepts the token (send from android application), then issues a request to an URL

Disallow multiple accounts in AccountManager

跟風遠走 提交于 2019-11-30 07:01:48
I've implemented my AccountManager authenticator and the service and the whole deal and it all seems to be working fine. There is, however, one little problem: I only want a single account for my app to exist in account manager, but can't quite seem to find a way to limit this. Is my only solution to do a search and delete the current accounts (by type) before adding the new account? My current code: private void removeAccounts() { Account [] accounts = mAcctMgr.getAccountsByType (mAccountType); if (accounts.length == 0) return; final Handler handler = new Handler (); AccountManagerCallback

Why is my AccountAuthenticatorActivity not launching when triggered by another app?

只愿长相守 提交于 2019-11-30 06:05:09
问题 I have a suite of apps and my AccountManager files live in one central app. I can use AccountManager.AddAccount() in that central app, but when I try to use that method from the other apps, the AuthenticatorActivity is not started. I can debug and see that all of the code from AddAccount is being executed, but the activity is never launched. Here is my AddAccount method: public override Bundle AddAccount(AccountAuthenticatorResponse response, string accountType, string authTokenType, string[]

SecurityException when trying to add an account

半腔热情 提交于 2019-11-30 04:46:45
问题 I'm experimenting with Android AccountManager . I have an Account authentication service that shows UI to enter username/password. I go to Settings/Accounts/Add Account, choose my new account type and I'm presented with the UI. When I click OK I get the following error 04-24 14:48:29.334: E/AndroidRuntime(386): java.lang.SecurityException: caller uid 10035 is different than the authenticator's uid The only method of MyAccountAuthenticationService: @Override public IBinder onBind(Intent intent

Twitter Authentication through Android's AccountManager classes

强颜欢笑 提交于 2019-11-30 03:58:27
I am working on a twitter based app and am trying to incorporate Android's built-in Account support for Twitter. The following code works to popup the confirmation dialog for my app to access twitter but I am unsure of what to pass in as the authenticationType. Any help would be appreciated. I've googled all over the place and can't seem to find the correct answer. It goes in place of "oauth" below. AccountManager am = AccountManager.get(this); Account[] accts = am.getAccountsByType(TWITTER_ACCOUNT_TYPE); if(accts.length > 0) { Account acct = accts[0]; am.getAuthToken(acct, "oauth"/*what goes