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

No token in local storage #76

Closed
LoliWizard opened this issue Aug 2, 2018 · 34 comments
Closed

No token in local storage #76

LoliWizard opened this issue Aug 2, 2018 · 34 comments
Labels

Comments

@LoliWizard
Copy link

Discord changed the way they handle tokens is there any other method to get your discord token?

@ghost
Copy link

ghost commented Aug 2, 2018

I can second this. Tried to export a chat today after a clean install and noticed the token key was either removed or moved.

@Robin-M
Copy link

Robin-M commented Aug 2, 2018

I'm having the same issue. After updating to a new version I noticed that the token was gone in the Discord developer console.

@Tyrrrz Tyrrrz added the bug label Aug 2, 2018
@Tyrrrz
Copy link
Owner

Tyrrrz commented Aug 2, 2018

It looks like it's indeed gone. Gonna mark it as a bug because the steps to obtain user token are no longer valid.

Also, note that old user tokens still work so if you still have your token saved somewhere -- make sure you don't lose it until workaround is found.

@Robin-M
Copy link

Robin-M commented Aug 2, 2018

Unfortunately I don't have my old token anymore. Even if I had, I have updated my password to see if the token returned, but it didn't.
Thank you for looking into it.

@Tyrrrz
Copy link
Owner

Tyrrrz commented Aug 2, 2018

As a more technical work-around you can do the following:

  1. Open developers console
  2. Click Network tab
  3. Go to any channel in any guild
  4. There should be a new request made messages?limit=50 or something similar, you may have to scroll to find it
  5. Click it
  6. On the right, make sure the Headers tab is open
  7. Scroll down to Request headers
  8. Find the authorization header and copy the value

@Robin-M
Copy link

Robin-M commented Aug 2, 2018

Thank you, that works for me.

@faithsloan
Copy link

WOW! THANK YOU! Worked like a charm, Tyrrrz!

#QueenWiki

@yeahalti
Copy link

yeahalti commented Aug 6, 2018

I can't find the authorization header. Can anyone else find it?

@Yudi Yudi mentioned this issue Aug 6, 2018
@llamasking
Copy link

The workaround works for me.
Make sure to save your token.

@sorarocks531
Copy link

sorarocks531 commented Aug 11, 2018

So.... I still can't find this authorization header.... In fact, I have no idea what you mean by "Go to any channel in any guild" And I don't even have a "Headers" Tab... Help please?

Update Ok so I found the "Headers" Tab.... but still have no idea where the Authorization value is... I have some that says "Provisional Headers are shown" that appears at the very to of the "Request Headers" tab... Is this anything I should be concerned about?

@llamasking
Copy link

llamasking commented Aug 12, 2018

screenshot_20180812_080423
@sorarocks531
@yeahalti

If the 'messages?limit=50' doesn't show up, either press F5 to reload the page, or swap to another channel.

@MaybeGoogle
Copy link

Note for blind people (I'm one of them): You don't have to use messages?limit=50. Any request to discord that would require you to be logged in should work. Most stuff towards the bottom without a file extension (science, applications, library are the additional ones I saw) will work.

Also, random observation: In science, a section called "Request Payload" has a property token which, at least for me, is slightly shorter than and ends differently from the authorization entry above. I'm too lazy to test if this one works, but I'm guessing it does...

@Tyrrrz
Copy link
Owner

Tyrrrz commented Aug 20, 2018

Yes, it doesn't have to be messages?limit=50 but it's generally the easiest to consistently find since it shows up every time you change channels.

@yeahalti
Copy link

Yep, got it! Thank you so much.

@BrianPetkovsek
Copy link

BrianPetkovsek commented Sep 4, 2018

Found a way of getting the token. (Only works on Discordapp)

  1. Open developers console
  2. Click Console tab
  3. reload the window with window.location.reload();
  4. The token should reappear back on the Application tab

@Tyrrrz
Copy link
Owner

Tyrrrz commented Sep 4, 2018

It would be nice if we could find perhaps an even easier solution, so that a non-technical person would be able to get token with minimal work, ultimately without having to go through Network tab at all.
I haven't had the opportunity to check solution @BrianPetkovsek proposed but if it works, it's amazing!

@Tyrrrz Tyrrrz closed this as completed in 8e38ada Sep 13, 2018
@Soheab
Copy link

Soheab commented Sep 17, 2018

Found a way of getting the token. (Only works on Discordapp)

  1. Open developers console
  2. Click Console tab
  3. reload the window with window.location.reload();
  4. The token should reappear back on the Application tab

Great ty! that works!

@Tyrrrz
Copy link
Owner

Tyrrrz commented Sep 17, 2018

The instruction notes have been updated in the app and in the wiki

@FOCI-DEV
Copy link

FOCI-DEV commented Nov 7, 2018

The instruction notes have been updated in the app and in the wiki

To automate this: https://github.com/FOCI-DEV/Get-Discord-Token

DaKing pushed a commit to DaKing/DiscordChatExporter that referenced this issue Jan 8, 2019
@generic-github-user
Copy link

Can't you be banned for using your user token in an automated program?

@Soheab
Copy link

Soheab commented Jan 16, 2019

Can't you be banned for using your user token in an automated program?

Yes it against discord’s T.O.S but people still do it xD

@Tyrrrz
Copy link
Owner

Tyrrrz commented Jan 16, 2019

There's very little logical incentive to ban people for this because there's no harm done, as opposed to e.g. automating your account to send spam messages. The TOS doesn't distinguish between different usages of user tokens, most likely to avoid getting into grey areas.

That said, even though nobody has ever been banned for this, use your user token at your own risk. If possible, use a bot token instead.

@generic-github-user
Copy link

Thanks for the explanation, I ended up using the below tool that runs as a bot and exports data from Discord servers to MongoDB databases.

https://github.com/Mega-Mewthree/Discord-Server-Exporter

@arunrdd
Copy link

arunrdd commented Feb 11, 2019

Interestingly, the token is visible briefly in the Application tab as soon as you reload the page. This suggests they are removing it from localStorage as soon as the page loads and inserting it back when the page is about to close.

Now, to get the access token, one simple way is to add a network profile in the networking tab and set download, upload speed to 0.01kb/s or some small value or set latency to really high value and reload the page. The access token will be available for you to copy a little longer depending on your network settings.

@Tyrrrz
Copy link
Owner

Tyrrrz commented Feb 11, 2019

This only seems to affect the web client right now. In my experience, you can still copy the value fast enough -- you just have to double click it and press Ctrl+C. It's fine if it still contains parentheses, they will get trimmed by DCE

@Tetrahedon
Copy link

The "Authorization" entry with the Token can now be found under HEADER > ACK (on the left) and then you will see the "authorization" entry on the right.

@leumasme
Copy link

leumasme commented May 20, 2020

The instruction notes have been updated in the app and in the wiki

To automate this: https://github.com/FOCI-DEV/Get-Discord-Token

consider using gist.github.com for single or few files @FOCI-DEV

@jaemin1508
Copy link

Open chrome developer tools and turn on device toolbar.
when site looks mobile, token will be saved in localstorage.

@rainyskye
Copy link

Easiest workaround seems to be just enable the "mobile" mode in your browsers development console, at-least for me, the token instantly appears when it switches to mobile mode?

@leumasme
Copy link

leumasme commented Jul 16, 2023

Here's a little script that you can paste into your dev console to get the token:

(webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken()

Alternatively

  • open the developer tools
  • go to the network tab
  • perform any action in discord that sends a request that needs your authentication (such as loading messages, sending a message, etc)
  • click on the request that appeared (which will be called "messages" for example for the message sent request)
  • switch to the header tab
  • scroll down to request headers
  • the value next to "Authorization" will be your discord token

@flashbackboi
Copy link

As a more technical work-around you can do the following:

  1. Open developers console
  2. Click Network tab
  3. Go to any channel in any guild
  4. There should be a new request made messages?limit=50 or something similar, you may have to scroll to find it
  5. Click it
  6. On the right, make sure the Headers tab is open
  7. Scroll down to Request headers
  8. Find the authorization header and copy the value

yea so i copy token it says invalid
helpppppp

@Ashio-Kun
Copy link

Hi, I was doing some research to find a way to get a token and I found this page. So I did what was said but I don't get the same token on web app as on desktop app, I notice the characters in the token change after the first dot. Does anyone know why ?

@Yudi
Copy link
Contributor

Yudi commented Mar 9, 2024

Hi, I was doing some research to find a way to get a token and I found this page. So I did what was said but I don't get the same token on web app as on desktop app, I notice the characters in the token change after the first dot. Does anyone know why ?

@Ashio-Kun the token format changed around the time Discord introduced the Devices tab. I suppose it allows differentiation between sessions and their independent termination.
It used to be the same for every device.

@Toxicisity
Copy link

Toxicisity commented Mar 22, 2024

Can't you be banned for using your user token in an automated program?

Yes it against discord’s T.O.S but people still do it xD

funny thing about this, i have made a whole account and use it as a portable bot, it has AI intelligent and more

and yet still my bot hasnt gotten banned/disabled :P

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

No branches or pull requests