Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

442
Views
Discord OAuth2 Error: 'invalid_client' when trying to get access token

I wanted to make website discord oauth2, but when I tested I got an error {error: 'invalid_client'}. I was searching everywhere and nothing helped. Can you please tell me how to use Discord OAuth2.

I am using Node.JS, Express, Request

    if(!req.query.code)
    return res.redirect("/")
const discordTokenData = await request.post({
    url: "https://discord.com/api/v9/oauth2/token",
    qs: {
        "client_id": client_id,
        "client_secret": client_secret,
        "grant_type": "authorization_code",
        "code": req.query.code,
        "redirect_uri": "http://localhost:3000/login",
        "scope": "identify email guilds guilds.join"
    },
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
}).catch((err) => console.log(err))
if(!discordTokenData)return console.log("err")
return res.send(discordTokenData.body)
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!