# databse.signIn throws APIError

**URL:** <https://community.auth0.com/t/databse-signin-throws-apierror/76178>\
**Category:** Get Help\
**Tags:** login\
**Created:** [January 11, 2022, 2:23pm UTC](https://community.auth0.com/t/databse-signin-throws-apierror/76178 "2022-01-11T14:23:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![valentin.ge](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/valentin.ge/32/34328_2.png) [@valentin.ge](https://community.auth0.com/u/valentin.ge)\
**Post date:** [January 11, 2022, 2:23pm UTC](https://community.auth0.com/t/databse-signin-throws-apierror/76178/1 "2022-01-11T14:23:26Z")

</div>

Good day,

we’re doing a “test drive” of your wonderful service, but we ran into an issue when we try to sign in a user.

We have a NodeJS service that is using your auth0 npm package (version ^2.37.0). We’re using this documentation: [https://auth0.github.io/node-auth0/module-auth.DatabaseAuthenticator.html](https://auth0.github.io/node-auth0/module-auth.DatabaseAuthenticator.html).

Thanks in advance!

Kind regards,  
Valentin

Our code looks like this:

```plaintext
const client = new AuthenticationClient({
  domain: process.env.AUTH0_ACCOUNT,
  clientId: process.env.CLIENT_ID
});

let signUpCreds = {
  email: `test1@test.bg`,
  password: 'asd',
  connection: 'Username-Password-Authentication'
};

client.database.signUp(signUpCreds, (error, userData) => {
  // This actually creates a user in your system
});

let signInCreds = {
  username: `test1@test.bg`,
  password: 'asd',
  connection: 'Username-Password-Authentication'
};

client.database.signIn(signInCreds, (error, userData) => {
  // This throws an error
});

```

The error:

```auto

SanitizedError {
  name: 'APIError',
  message: '{}',
  statusCode: 404,
  requestInfo: { method: 'post', url: 'https://...auth0.com/oauth/ro' },
  originalError: Error: Not Found
      at Request.callback (.../node/index.js:879:15)
      at IncomingMessage.<anonymous> (.../node/index.js:1129:18)
      at IncomingMessage.emit (node:events:406:35)
      at endReadableNT (node:internal/streams/readable:1329:12)
      at processTicksAndRejections (node:internal/process/task_queues:83:21) {
    status: 404,
    response: Response {
      _events: [Object: null prototype] {},
      _eventsCount: 0,
      _maxListeners: undefined,
      res: [IncomingMessage],
      request: [Request],
      req: [ClientRequest],
      text: 'Not Found',
      body: {},
      files: undefined,
      buffered: true,
      headers: [Object],
      header: [Object],
      statusCode: 404,
      status: 404,
      statusType: 4,
      info: false,
      ok: false,
      redirect: false,
      clientError: true,
      serverError: false,
      error: [Error],
      created: false,
      accepted: false,
      noContent: false,
      badRequest: false,
      unauthorized: false,
      notAcceptable: false,
      forbidden: false,
      notFound: true,
      unprocessableEntity: false,
      type: 'text/plain',
      charset: 'utf-8',
      links: {},
      setEncoding: [Function: bound],
      redirects: [],
      pipe: [Function (anonymous)],
      [Symbol(kCapture)]: false
    }
}

```

---

<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:** [January 11, 2022, 11:25pm UTC](https://community.auth0.com/t/databse-signin-throws-apierror/76178/3 "2022-01-11T23:25:11Z")

</div>

Hi @valentin.ge,

Welcome to the Auth0 Community!

I understand you have encountered errors logging in using the AuthenticationClient.

I am taking a look at this issue and will get back when I have more information.

Thank you.

---

<div class="post-metadata">

**Author:** ![valentin.ge](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/valentin.ge/32/34328_2.png) [@valentin.ge](https://community.auth0.com/u/valentin.ge)\
**Post date:** [January 12, 2022, 7:06am UTC](https://community.auth0.com/t/databse-signin-throws-apierror/76178/4 "2022-01-12T07:06:08Z")

</div>

Thank you, kind sir!

A forgot to mention, that we tried to connect to Regular Web App and to Machine to Machine App. Currently, I left only the first app. I think I missed a configuration.

Thanks again!

---

<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:** [January 14, 2022, 4:38pm UTC](https://community.auth0.com/t/databse-signin-throws-apierror/76178/5 "2022-01-14T16:38:27Z")

</div>

Hi @valentin.ge,

Thank you for your response and patience.

I have thoroughly tested the Authentication API and found that the **auth0.database.signIn()** method is calling the `/oauth/ro` endpoint, which is a legacy endpoint and replaced in favor of the Password Grant with `oauth/token`.

Given that, I can confirm that the error is to be expected and hence why the endpoint is not reachable.

In this case, you will need to use the [Password Grant](https://auth0.com/docs/api/authentication#resource-owner-password) to authorize your user.

Please let me know if you have any questions or concerns.

Thanks!

---

<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:** [January 29, 2022, 4:39pm UTC](https://community.auth0.com/t/databse-signin-throws-apierror/76178/6 "2022-01-29T16:39:19Z")

</div>

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