We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.

Forum Discussion

Fomka_Wyverno's avatar
Fomka_Wyverno
New member | Level 2
12 months ago

Get Access Token JavaScript in fetch

    const parameters = { 'code': params.code, 'grant_type': 'authorization_code', 'redirect_uri': window.location.origin, ...
  • Greg-DB's avatar
    Greg-DB
    12 months ago

    It looks like you're sending the parameters as JSON, but the /oauth2/token endpoint expects them as application/x-www-form-urlencoded POST parameters, and so your parameters aren't getting read. Update your implementation to send application/x-www-form-urlencoded POST parameters instead.