# Login and registration API issue

**URL:** <https://community.auth0.com/t/login-and-registration-api-issue/79883>\
**Category:** Get Help\
**Created:** [March 15, 2022, 7:24am UTC](https://community.auth0.com/t/login-and-registration-api-issue/79883 "2022-03-15T07:24:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![skypearl.infotech](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/skypearl.infotech/32/35849_2.png) [@skypearl.infotech](https://community.auth0.com/u/skypearl.infotech)\
**Post date:** [March 15, 2022, 7:24am UTC](https://community.auth0.com/t/login-and-registration-api-issue/79883/1 "2022-03-15T07:24:07Z")

</div>

I want to use login and register api in my application. For that I read the docs [https://auth0.com/docs/api/authentication](https://auth0.com/docs/api/authentication). Here, mention use your domain (https://YOUR\_DOMAIN) in all API.

I don’t know where to find my domain. As per my knowledge I tried to use application domain and custom domain. But also, does’t work for me. I got the response of not found.

Can you help me? How to use your login and registration api? Can you send me the exact curl request to me?

Regards,

---

<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:** [March 15, 2022, 4:59pm UTC](https://community.auth0.com/t/login-and-registration-api-issue/79883/3 "2022-03-15T16:59:54Z")

</div>

Hi @skypearl.infotech,

Thanks for reaching out to the Auth0 Community!

I understand that you are looking for assistance using the Auth0 Authentication API.

First, your domain should be in the format `https://YOUR_DOMAIN.REGION.auth0.com`. For example: `https://dev-12345.us.auth0.com`

To verify, you can find your **Domain** in your [Auth0 Dashboard \> Application \> Any App](https://manage.auth0.com/#/applications) settings.

> [@skypearl.infotech](#):
>
> Can you help me? How to use your login and registration api? Can you send me the exact curl request to me?

Now, to begin login you must initiate the authorization code flow by calling the `/authorize` request to obtain a code:

```auto
https://YOUR_DOMAIN/authorize?
    response_type=code&
    client_id=YOUR_CLIENT_ID&
    redirect_uri=https://YOUR_APP/callback&
    scope=SCOPE&
    state=STATE

```

Once you obtain the authorization code you can exchange it for an access token:

```auto
curl --request POST \
  --url 'https://YOUR_DOMAIN/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'grant_type=authorization_code&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&code=AUTHORIZATION_CODE&redirect_uri=https://YOUR_APP/callback'

```

And for sign up:

```auto
curl --request POST \
  --url 'https://YOUR_DOMAIN/dbconnections/signup' \
  --header 'content-type: application/json' \
  --data '{"client_id":"YOUR_CLIENT_ID", "email":"test.account@signup.com", "password":"PASSWORD", "connection":"CONNECTION", "username": "johndoe", "given_name": "John", "family_name": "Doe", "name": "John Doe", "nickname": "johnny", "picture": "http://example.org/jdoe.png", "user_metadata":{ "plan": "silver", "team_id": "a111" }}'

```

If you have a moment, please read our [Authorization Code Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-auth-code-flow) doc to learn more.

Please let me know if there’s anything else I can do to help.

Thank you.

---

<div class="post-metadata">

**Author:** ![akash3](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/akash3/32/34068_2.png) [@akash3](https://community.auth0.com/u/akash3)\
**Post date:** [March 15, 2022, 7:26am UTC](https://community.auth0.com/t/login-and-registration-api-issue/79883/4 "2022-03-15T07:26:46Z")

</div>

I want to use login and register api in my application. For that I read the docs [https://auth0.com/docs/api/authentication](https://auth0.com/docs/api/authentication). Here, mention use your domain (https://YOUR\_DOMAIN) in all API.

I don’t know where to find my domain. As per my knowledge I tried to use application domain and custom domain. But also, does’t work for me. I got the response of not found.

Can you help me? How to use your login and registration api? Can you send me the exact curl request to me?

Regards,

---

<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:** [March 15, 2022, 5:04pm UTC](https://community.auth0.com/t/login-and-registration-api-issue/79883/5 "2022-03-15T17:04:59Z")

</div>

Hi @akash3,

Welcome to the Auth0 Community!

This question has been posted by another community member, and I have merged the Topics.

Thank you.

---

<div class="post-metadata">

**Author:** ![akash3](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/akash3/32/34068_2.png) [@akash3](https://community.auth0.com/u/akash3)\
**Post date:** [March 16, 2022, 8:57am UTC](https://community.auth0.com/t/login-and-registration-api-issue/79883/6 "2022-03-16T08:57:54Z")

</div>

```auto
{
    "error": "connection not found"
}

```

I got this response when I called register api

---

<div class="post-metadata">

**Author:** ![akash3](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/akash3/32/34068_2.png) [@akash3](https://community.auth0.com/u/akash3)\
**Post date:** [March 16, 2022, 8:59am UTC](https://community.auth0.com/t/login-and-registration-api-issue/79883/7 "2022-03-16T08:59:19Z")

</div>

Here, given solution is not solved my problem.

---

<div class="post-metadata">

**Author:** ![skypearl.infotech](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/skypearl.infotech/32/35849_2.png) [@skypearl.infotech](https://community.auth0.com/u/skypearl.infotech)\
**Post date:** [March 16, 2022, 9:00am UTC](https://community.auth0.com/t/login-and-registration-api-issue/79883/8 "2022-03-16T09:00:34Z")

</div>

> [@akash3](#):
>
> ```auto
> {
> "error": "connection not found"
> }
> 
> ```

Also, I got same error when I called the register api.

---

<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:** [March 16, 2022, 3:42pm UTC](https://community.auth0.com/t/login-and-registration-api-issue/79883/9 "2022-03-16T15:42:01Z")

</div>

Hi @skypearl.infotech, @akash3,

Thank you for your response.

The error you received, specifically, “connection not found” indicates that you are trying to login against a connection name that does not exist.

In this case, you are calling the sign-up endpoint with a database connection that doesn’t exist. Therefore you must make sure that the values you pass for the `connection` parameter match the name of your connection in the Auth0 Dashboard.

To do so, you will need to go to your [Auth0 Dashboard \> Authentication \> Database](https://manage.auth0.com/dashboard/us/onboarding-tiow/connections/database) and make sure that your CURL request references the correct **Connection Name** , for example, _Username-Password-Authentication._

Once that is complete, you can call the signup endpoint successfully. I have tested this and can confirm that it works.

Thanks.

---

<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:** [December 21, 2022, 5:14pm UTC](https://community.auth0.com/t/login-and-registration-api-issue/79883/10 "2022-12-21T17:14:42Z")

</div>


