# Username-Password-Authentication is intermittently failing

**URL:** <https://community.auth0.com/t/username-password-authentication-is-intermittently-failing/104269>\
**Category:** Get Help\
**Tags:** passwordless-email-connection, connections\
**Created:** [April 6, 2023, 7:34pm UTC](https://community.auth0.com/t/username-password-authentication-is-intermittently-failing/104269 "2023-04-06T19:34:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian.takita](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brian.takita/32/46137_2.png) [@brian.takita](https://community.auth0.com/u/brian.takita)\
**Post date:** [April 6, 2023, 7:34pm UTC](https://community.auth0.com/t/username-password-authentication-is-intermittently-failing/104269/1 "2023-04-06T19:34:31Z")

</div>

I have an app which is using Username-Password-Authentication. The login was previously working but has been failing off & on over the past few days.

Here is my fetch function:

```auto
	return await fetch_response_pair_(`https://${AUTH0_DOMAIN_(ctx)}/oauth/token`, {
		method: 'POST',
		headers: { 'Content-Type': 'application/json' },
		body: JSON.stringify(body)
	})

```

Where the body is:

```auto
{
    username: 'USERNAME',
    password: 'PASSWORD',
    client_id: 'CLIENT_ID,
    client_secret: 'CLIENT_SECRET,
    grant_type: 'password',
    audience: 'https://mi-www.us.auth0.com/api/v2/',
    scope: 'openid profile email',
    connection: 'Username-Password-Authentication',
    realm: 'Username-Password-Authentication'
  }

```

The response log is:

```auto
POST /auth|payload|error {
  status: 403,
  payload: {
    error: 'invalid_grant',
    error_description: 'Wrong email or password.'
  }
}

```

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 19, 2023, 1:27pm UTC](https://community.auth0.com/t/username-password-authentication-is-intermittently-failing/104269/3 "2023-04-19T13:27:16Z")

</div>

Hi @brian.takita,

Welcome back to the Auth0 Community!

Apologies for the delay. Are you still seeing this issue?

That error typically indicates a bad username/password. Let me know if you have any more info.

---

<div class="post-metadata">

**Author:** ![brian.takita](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/brian.takita/32/46137_2.png) [@brian.takita](https://community.auth0.com/u/brian.takita)\
**Post date:** [June 6, 2023, 11:18pm UTC](https://community.auth0.com/t/username-password-authentication-is-intermittently-failing/104269/4 "2023-06-06T23:18:34Z")

</div>

It seems like it’s working consistently now. Thank you.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [June 7, 2023, 8:56am UTC](https://community.auth0.com/t/username-password-authentication-is-intermittently-failing/104269/5 "2023-06-07T08:56:42Z")

</div>

Glad to hear that and thanks for sharing!

---

<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:** [June 21, 2023, 8:57am UTC](https://community.auth0.com/t/username-password-authentication-is-intermittently-failing/104269/6 "2023-06-21T08:57:06Z")

</div>

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