# Invalid user credentials

**URL:** <https://forum.mautic.org/t/invalid-user-credentials/7426>\
**Category:** Development\
**Created:** [February 7, 2017, 11:44pm UTC](https://forum.mautic.org/t/invalid-user-credentials/7426 "2017-02-07T23:44:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheWinterMan](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@TheWinterMan](https://forum.mautic.org/u/TheWinterMan)\
**Post date:** [February 7, 2017, 11:44pm UTC](https://forum.mautic.org/t/invalid-user-credentials/7426/1 "2017-02-07T23:44:27Z")

</div>

I’m trying to send post request(as said in docs) to get access token but instead of token I’m getting this:  
  
`{"error":"invalid_client","error_description":"The client credentials are invalid"}`  
  
client\_secret & client\_id are right. I even tried to create a new keys but it didn’t make it work.  
  
  
  
part of my code.

Code:

var params = "client\_id=" + id + "&client\_secret" + secret +"&grant\_type=authorization\_code&redirect\_uri=https%3A%2F%2Fsnackimpact.mautic.net%2F&code=UNIQUE\_CODE\_STRING"; console.log('in...'); xhr.open("POST", combo1); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onreadystatechange = function() { console.log(xhr.responseText); if(xhr.readyState == 4 && xhr.status === 200) { var res = xhr.response; var parse = JSON.parse(res); } console.log(status); }; xhr.send(params);

I don't think that it is error on my side i.e. all credentials are right.  
Cheers,  
Ivan.

---

<div class="post-metadata">

**Author:** ![TheWinterMan](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@TheWinterMan](https://forum.mautic.org/u/TheWinterMan)\
**Post date:** [February 7, 2017, 11:44pm UTC](https://forum.mautic.org/t/invalid-user-credentials/7426/2 "2017-02-07T23:44:27Z")

</div>

I’m trying to send post request(as said in docs) to get access token but instead of token I’m getting this:  
`{"error":"invalid_client","error_description":"The client credentials are invalid"}`  
client\_secret & client\_id are right. I even tried to create a new keys but it didn’t make it work.

part of my code.

`var params = "client_id=" + id + "&client_secret" + secret +"&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fsnackimpact.mautic.net%2F&code=UNIQUE_CODE_STRING";
  console.log('in...');
  xhr.open("POST", combo1);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  xhr.onreadystatechange = function()
  {
    console.log(xhr.responseText);
    if(xhr.readyState == 4 && xhr.status === 200)
    {
      var res = xhr.response;
      var parse = JSON.parse(res);
    }
      console.log(status);
  };
  xhr.send(params);`  
I don’t think that it is error on my side i.e. all credentials are right.  
Cheers,  
Ivan.
