Users of social networks are used to using login and password as the data for authorization in services. Others go further and prefer to use a QR code to enter. However both these methods are too distressing and inconvenient when it is necessary to connect a bot to your account or to authorize in the service via a third-party application. In this case, tokens come to the aid of Diskord. We’ll tell you how to use a token in Discord and what to do if it’s out of date.
What is a token in Discord
So, if you’re interested in the topic of working with tokens, you’re probably:
- You need to log in through a third-party service in Discord, and the standard username and password are not accepted.
- You need to develop a bot for the server in Discord. This is most likely your first bot, as the topic of token usage is explored in the beginning.
- We need to develop our own application in which there is authorization through Diskord.
Otherwise, you are just curious about the meaning of the term, because it is often glimpsed in material about computers. In any case, the term itself has only one definition.
A token is a kind of identification key that allows you to authorize or connect to an account. Unlike logins and passwords, a token is one big generated string, not two user strings.
Another distinctive feature of tokens is that their validity period and access rights are easily configurable, and they are disposable (not always). For example, if you want to give access only to the account name and only for 24 hours, you set these options, and voila: a token with custom settings is ready.
However, the description above refers to the term “token” itself. In Discord, the term “token” means a kind of authentication key, which allows you to refer to the bot created (when it is developed) or to pass authorization in third-party services. There are even token grabbers, which allow you to read the data from the account.
And yet, even if the data gets into some pirate database, it can be revoked or reset. In general, the advantage of tokens in their compactness and security.
How to get one
So, to get a token for a bot, you first need to create that bot. To do that you need to have programming skills. However, let’s skip the development point. Here, you have a ready bot, which remains to connect to Discord with the token. To do this, do the following steps:
- Open the Discord website for developers. You can find it at this link https://discord.com/developers/applications
- Click on the “New Application” button.
- Choose a name for the new application.
- Fill in the necessary data for the bot. There you need to specify its description, as well as its status. However, all of this is optional.
- Go to the “Bot” section.
- Find the header of the “Token” field. There will be a “Click to Reveal token” link below it. Click on it.
- Instead of the link, you will see a long text consisting of symbols and numbers.
Congratulations, you have found a token for your bot. Now you only need to specify this token in the code. By the way, to add the bot to the server, the token will not help, you need to get a special link, which is located in the same section. By the way, here you can also reset the old token and generate a new one. To do this, click on the blue button “Regenerate”. Keep in mind that after this, the old token will lose relevance, and therefore bots on the servers will stop working.
How to know the Discord token for authentication
The method above was great if you wanted to get a token to connect to a single bot. But what if you want to connect to your own account instead of the bot? In that case, you’ll have to use another method. Algorithm of action:
- Open the main page of Discord in the browser. There is nothing you can do through the installed version.
- Press “F12” (or “Ctrl” + “Shift” + “I”). Should open the developer tools.
- Go to “Network”.
- Type “/api/v9” into the search box.
- Open any file you find.
- Go to “Headers”. The default selection there is “Preview” if you’re sitting in Google chrome.
- Scroll down to the “Authorization” line. After that, your token will be listed.
- Copy it.
Done. Now you can put it in the right field for authorization. Keep in mind that your token is the same as your authorization data, so you should not leave it out in plain sight.
How to sign in with the token
So, you will not be able to login directly with the token. It is not sent by GET-request, which means that simply copying the text into the URL string is not possible. However, do not get frustrated and resent why these instructions above. Token is often used by third-party services for authorization.
If necessary, you can copy the identification text exactly there. But keep in mind, the token is tied to a single session in Discord. That is, if the user clicks the “Logout” button, the token will automatically become invalid.
Can I Buy?
Quite often people on the Internet offer to buy a token for a small round sum. On the one hand, why not, because it is profitable, the price is almost paltry. But do not fall for it, because most of these offers come from scammers. The remaining share of sellers can sell a token, but not yours, but someone else’s. And it will cease to be valid when the owner resets or ends the session.
Remember, all token-types of your bots and accounts are obtained free of charge and without intermediaries. You should not believe these trivial schemes of scammers.
Token is out of date: what does it mean?
You have strictly followed the instructions above and everything seems to work out, the authorization through Diskord was successful, the bot is connected and everything seems to be perfect. However, after some time, suddenly this instruction does not work anymore, and instead of the desired result appears the error “The token is out of date”. What to do in this case?
As we mentioned above, these secret tokens are easy to revoke. To do this with the bot, just go to the control panel of the application, in the section “Bot” and click “Regenerate”, and then copy the new data. Done, it remains to throw the new data into the code with the bot and be happy with the result.
To reset the token for the account, just log out of the profile on the site where you copied the token. After logging in again, repeat the algorithm from the “How to know the Diskord token for authentication” section. Write down the new data in a safe place, and then copy it to the service settings where the error occurred. As you have already understood, the outdated token is not a critical error, but only a security measure to save you from the very scammers who sell accounts.
We hope that these methods helped you. If you still have questions, feel free to ask them in the comments.