# Invalid grant for user signup

**URL:** <https://community.auth0.com/t/invalid-grant-for-user-signup/109775>\
**Category:** Get Help\
**Tags:** user-password-management, user-management\
**Created:** [June 22, 2023, 3:17pm UTC](https://community.auth0.com/t/invalid-grant-for-user-signup/109775 "2023-06-22T15:17:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shola.agunbiade](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@shola.agunbiade](https://community.auth0.com/u/shola.agunbiade)\
**Post date:** [June 22, 2023, 3:17pm UTC](https://community.auth0.com/t/invalid-grant-for-user-signup/109775/1 "2023-06-22T15:17:57Z")

</div>

{“error”:“invalid\_grant”,“error\_description”:“Wrong email or password.”}

I’m testing new user signups and facing the error above when testing a new user signup which sends a POST request with the payload below. The issue seems to be environment related as exact same request and payload works fine in another environment under the same auth0 account. What could cause this error?

{  
“client\_id”: “**",  
“username”: "**”,  
“password”: “**",  
“realm”: "**”,  
“grant\_type”: “[http://auth0.com/oauth/grant-type/password-realm](http://auth0.com/oauth/grant-type/password-realm)”,  
“scope”: “openid email profile”,  
“audience”: “**",  
“redirect\_uri”: "**”  
}

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [June 23, 2023, 12:47am UTC](https://community.auth0.com/t/invalid-grant-for-user-signup/109775/3 "2023-06-23T00:47:01Z")

</div>

Hi @shola.agunbiade,

Welcome to the Auth0 Community!

To better understand the issue, could you please share the exact steps and code you performed so far?

At the moment, I do not have context of where the POST request is going to.

I look forward to your udpate.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [June 23, 2023, 4:08pm UTC](https://community.auth0.com/t/invalid-grant-for-user-signup/109775/4 "2023-06-23T16:08:26Z")

</div>

Hi @shola.agunbiade,

I have an update!

The “Wrong email or password” error description is stating that the issue is coming from either a wrong email or password. (Reference: [Invalid\_grant error code received instead of documented error codes - #7 by thomas.osborn](https://community.auth0.com/t/invalid-grant-error-code-received-instead-of-documented-error-codes/13021/7))

Because of this, I decided to test the Password-realm grant type on my end. In my tests, I could successfully get an access token with the following code:

```auto
const axios = require('axios');
const qs = require('qs');
let data = qs.stringify({
  'grant_type': 'http://auth0.com/oauth/grant-type/password-realm',
  'client_id': 'YOUR_CLIENT_ID',
  'client_secret': 'YOUR_CLIENT_SECRET',
  'audience': 'YOUR_AUDIENCE',
  'username': 'YOUR_EMAIL_ADDRESS',
  'password': 'YOUR_PASSWORD',
  'scope': 'openid email profile',
  'realm': 'Username-Password-Authentication' 
});

let config = {
  method: 'post',
  url: 'https://YOUR_DOMAIN.REGION.auth0.com/oauth/token',
  headers: { 
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

Then, the only way I could reproduce the"Wrong email or password" error is if I passed in an incorrect email address or password.  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/a/b/ab29de1803120ec2641084c46da55501cd5f4431.png)

Given that, could you please make sure you are passing the correct email address and password values in the request?

After doing so, you should be able to make the request using the Password-realm grant.

Please let me know how this goes for you.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![shola.agunbiade](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@shola.agunbiade](https://community.auth0.com/u/shola.agunbiade)\
**Post date:** [June 23, 2023, 4:49pm UTC](https://community.auth0.com/t/invalid-grant-for-user-signup/109775/5 "2023-06-23T16:49:42Z")

</div>

Hi @rueben.tiow, thanks for following up. In my case I’m testing new user signup so email and password are provided for the first time at this stage.

I’ll follow up and this point of the documentation “or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request”. Perhaps is issue is with the redirection.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [June 26, 2023, 4:47pm UTC](https://community.auth0.com/t/invalid-grant-for-user-signup/109775/6 "2023-06-26T16:47:32Z")

</div>

Hi @shola.agunbiade,

Thank you for your reply.

Would you be able to help me [capture a HAR file of your login events](https://auth0.com/docs/troubleshoot/troubleshooting-tools/generate-and-analyze-har-files) and share them with me via direct messages to investigate the issue further?

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 10, 2023, 4:47pm UTC](https://community.auth0.com/t/invalid-grant-for-user-signup/109775/7 "2023-07-10T16:47:45Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
