Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

How to use

  1. Copy one of the consumer key pairs to Twidere - Settings - Network - Advanced - Default API Settings
  2. Remove account from Twidere (or just skip this step)
  3. Re-login. It's OK to see "You've already logged in" message.


Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA
Consumer secret: 172fOpzuZoYzNYaU3mMYvE8m8MEyLbztOdbrUolU

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg
Consumer secret: IQWdVyqFxghAtURHGeGiWAsmCAGmdW3WmbEx6Hck

Twitter for Mac (No longer available)

Consumer key: 3rJOl1ODzm9yZy63FACdg
Consumer secret: 5jPoQ5kQvMJFDYRNE8bQ4rHuds4xJqhvgNJM4awaE8

Twitter for Windows Phone

Consumer key: yN3DUNVO0Me63IAQdhTfCA
Consumer secret: c768oTKdzAjIYCmpSNIdZbGaG0t6rOhSFQP0S5uC79g


Consumer key: yT577ApRtZw51q4NPMPPOQ
Consumer secret: 3neq3XqN5fO3obqwZoajavGFCUrC42ZfbrLXy5sCv8

This comment has been minimized.

Copy link

commented Jul 1, 2013

not work


This comment has been minimized.

Copy link

commented Feb 15, 2014

How to apply consumer key and secret:

  1. Logout All accounts.
  2. Input this key/secret
  3. Login.

This comment has been minimized.

Copy link

commented May 31, 2014

Thanks 👍


This comment has been minimized.

Copy link

commented Dec 31, 2014

It doesn't work anymore? It show error 401 after authorize app.


This comment has been minimized.

Copy link

commented Apr 27, 2015

I was sent here from the Android Play Store app description. I have to say to expect any user to know what is meant by "activity tab" and "rate limit" is an unreasonable demand. Why is info on how to apply these keys in a user comment?
This page features not a single line of information on why it exists. It is from 2013, and it is not transparent that this is still relevant information. (And it is, right? According to the shop description.)


This comment has been minimized.

Copy link

commented May 6, 2015

philip, the reason probably has to do with the twitter API unfortunately. Twitter's API poses numerous problems for developers and makes it very hard to work properly. Specifically, the hard limit on the API for tokens probably a huge factor in this, they probably put it on the description page so that not everyone uses it and they don't reach their limit.


This comment has been minimized.

Copy link

commented Jun 4, 2015

Crashes on android M developer preview.


This comment has been minimized.

Copy link

commented Dec 24, 2015

I've used the Twitter for Android key, put a tab on Twidere for Actives about me, but it only seems to update once or very very slowly? The Official Twitter Android client is showing favourites that don't appear in Twidere for Activities about me, not sure why hoping someone else might know.


This comment has been minimized.

Copy link

commented Jul 7, 2016

Changed the key to Twitter for Android and get an "Error 400" now if I try to post a photo. Any idea on how to solve this?


This comment has been minimized.

Copy link

commented Oct 22, 2016

Some more pairs are listed here.
I have used the "Twitter for Android" pair probably more than 10 times due to reinstalling Android often and I've never had a problem but definitely less rate limit problems/other improvements.


This comment has been minimized.

Copy link

commented Jan 31, 2017

Fixed! This deserve a medal.


This comment has been minimized.

Copy link

commented Apr 25, 2017

Tweetdeck key doesn't work anymore, I only trust the TweetDeck key from all of official key because search function doesn't limited to show popular tweet first.


This comment has been minimized.

Copy link

commented Dec 7, 2018

Superb! Works like a charm.


This comment has been minimized.

Copy link

commented Mar 12, 2019

Stopped working today (you can continue to use but can't login anymore)


This comment has been minimized.

Copy link

commented Mar 12, 2019

It is a probability that the official apps have switched to the callback method (at least, Twidere behaves the same way as if I specify other keypairs with callback type from here). I suggest everybody who has signed in using the official keys to make a full backup of Twidere data, everybody else keep your fingers crossed and hope the team can do something about it.


This comment has been minimized.

Copy link

commented Mar 19, 2019

How would I go about making and restoring a backup? I've tried Titanium Backup and restoring it after flashing a different ROM but as soon as I open Twidere again it takes me to the login screen again


This comment has been minimized.

Copy link

commented Apr 27, 2019

@ivantyr Maybe you have a native Android backup (i. e. via Helium Backup or adb)? It did work for me, although I'm not 100% sure.


This comment has been minimized.

Copy link

commented May 10, 2019

If anyone else is having trouble with this, here is what I did:

  1. BE EXTREMELY CAREFUL IF YOU FOLLOW THESE INSTRUCTIONS! You will be editing one of Android's system files and if you break the file your phone will likely fail to boot.

ALSO IMPORTANT: You will need to have a phone where you are already logged into the accounts using these official API keys. This is because we will be copying over the credentials from that phone to your new one. If you aren't already logged in with these API keys somewhere, as far as I know, you are out of luck, sorry.

Anyway, from now on I will refer to the phone you're trying to use the official keys on as the "new" phone. The "old" phone is the one where you already have your twitter accounts logged in an d working properly with the official API keys/secrets above.

  1. Make a backup of your new phone's /data/system_ce/0/accounts_ce.db file. This is the file we will be editing. You will need root to access this file. If you mess up this file, your phone will not boot, but simply swapping out the broken file for the backup you made should fix it (it did for me!). If you are unable to log into your phone, you can use adb to get shell access to your phone and manually restore your backed up copy to the original location. Do some googling if you aren't familiar with that.

However, despite all the above, I don't think it is likely you will break your phone if you follow these instructions carefully.

  1. On your new phone, make sure you've already added all of the accounts you want to use these API keys for. For now it's fine to just log into the accounts normally, with Twidere's API key and secret. We will be manually editing the stored API keys and secrets shortly. Close twidere, "Force Stop" it from your phone's settings under "Apps", and then under the "Storage" section for Twidere, click "CLEAR CACHE", just to be safe.

  2. Download "SQLite Editor" app from Google Play: It is free of charge and worked wonderfully for me. When I used this app, I did not have any of the aforementioned problems mentioned in #2. But still, be careful!

  3. In SQLite Editor, open /data/system_ce/0/accounts_ce.db. Again, you will likely need root on your phone to be able to do this.

  4. Tap "authtokens".

  5. Look for any lines whose "type" says org.mariotaku.twidere.account.token. Tap to select one of those lines, then click "..." in the upper right of the screen and press "Edit".

  6. Under the "authtoken" header, you should see something that starts off with text like {"access_token": . If you see that, you are in the right spot! Again, make sure "type" is org.mariotaku.twidere.account.token.

  7. Repeat steps 4-8 on your old phone.

  8. Make sure the text after "access_token": is in the format "XXXXXXXXXX-NNNNN...". The XXXXXXXXXX should be 10 or so numbers, and the "NNNNN..." part is various numbers and letters (I didn't count how many). These are separated with a dash -. I believe the XXXXXXXXXX is your twitter account ID. The account IDs need to match. Otherwise, go back to step 7 on the old phone and find a different line that has org.mariotaku.twidere.account.token as its type. Once you find a line on your old phone where the twitter account ID matches, proceed to step 11.

  9. Copy the entire text under "authtoken" from your old phone. Email it to yourself or something so you can access that exact text from your new phone. Then erase the "authtoken" field on your new phone and paste in the "authtoken" text you got from your old phone. Click the "EDIT" button at the bottom to save your changes.

  10. For each twitter account you want to use the official API keys for, repeat steps 5-11. I would suggest keeping track of the account IDs of each account after you've done those steps for them so you only do them once and don't miss any. Obviously if you only have one twitter account, don't worry about this step.

  11. The hard part is over. Hooray.

  12. Press back in the SQLite editor app until you get to the screen where you clicked "authtokens". Below it, you should see another line that says "extras". Click it.

  13. Find any lines whose "key" value says extras. Then, scroll over to the right a bit and make sure its "value" field says {"official_credentials":false}. Tap on this line to highlight it, then click "..." in the upper right and then "edit" again.

  14. Change the false part to true. Click "EDIT" to save this entry again.

  15. For each twitter account you have, repeat steps 15 and 16, or until there are no more lines that say {"official_credentials":false}. All of the twitter accounts you want to use the official credentials for will need to say true or else twidere will not know it has official credentials.

  16. Restart your phone.

  17. If you did everything correctly, you will now be using the official API key and secret again for the accounts.

  18. Hooray.

  19. If you use the SQLite Editor app, it's unlikely you will have broken anything, however if you have, you will just need to rollback your /data/system_ce/0/accounts_ce.db file to the backup of it that you made. Remember you can use the adb utility from your computer to get into a shell. adb is even more dangerous than the SQLite Editor, though!

Thinking about it now, it MAY be possible to use this same file to find the official Twitter app's API keys/secrets/etc and copy them into twidere's format, but I'm so disgusted by the official app that I haven't even checked if it stores its information in this database. If you're up to that challenge, or know where to look for the official app's API keys/secrets/etc, then it might just work.

  1. Give both Twidere and SQLite Editor 5 stars on the play store. Consider donating or purchasing them to support their authors.

  2. Consider using Mastodon instead of Twitter, since having to do all of this is Twitter's fault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.