Login and registration API issue

I want to use login and register api in my application. For that I read the docs Authentication API Explorer. 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,

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 settings.

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

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:

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:

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 doc to learn more.

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

Thank you.

I want to use login and register api in my application. For that I read the docs Authentication API Explorer. 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,

Hi @akash3,

Welcome to the Auth0 Community!

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

Thank you.

{
    "error": "connection not found"
}

I got this response when I called register api

Here, given solution is not solved my problem.

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

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 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.