Auth0 Home Blog Docs

Custom database - defining the server



I am trying to connect auth0 to my local sql server database.
Here’s the part of action script where I define the server and database.

function login(email, password, callback) {
  var connection = sqlserver.connect({
    server: 'ACTKPTP115\\SQLTEST',
    options: {
      database: 'najava',
      rowCollectionOnRequestCompletion: true

Trying this I get the following error:

connection to ACTKPTP115\SQLTEST:1433 - failed Error: getaddrinfo ENOTFOUND ACTKPTP115\SQLTEST ACTKPTP115\SQLTEST:1433

Changing it to ‘localhost’ only gives a different error:

connection to localhost:1433 - failed Error: connect ECONNREFUSED

The problem is that it can’t reach my server. I tried various other names; here is the wt-cli output for some attempts:
![alt text][1]

Here is the picture of my database in Sql server and its properties:
![alt text][2]

I am using this database in my angular application without trouble and I have no trouble accessing it through the application.
The string in my application is the following:

"ConnectionStrings": {
    "DefaultConnection": "Server=ACTKPTP115\\SQLTEST; Database=najava;Trusted_Connection=True;MultipleActiveResultSets=true;"

I made sure to allow all the inbound IP’s in the firewall.

Please advise me on how to find out what I should define under server to get it to connect.


I’m assuming you’re using the Auth0 Cloud service and not an on-premise installation of Auth0. When using the cloud service, any server that you want to call from a custom database script needs to be accessible from the public cloud; Internet.

The ACTKPTP115 name is known on your local network, but the custom database script running on the cloud will not be able to resolve that name, hence the Error: getaddrinfo ENOTFOUND.

When you switched to localhost you asked the script to connect to the machine where the script itself runs which isn’t running anything on that port, hence the: Error: connect ECONNREFUSED.

You need to provide either a host name that can be resolved publicly or a static IP address reachable from the Internet. Additionally, if your server runs behind a firewall you’ll need to configure it to allow to receive connection from the Auth0 cloud service. Withing the custom database connection configuration pages you’ll find a list of IP address that you would have to white-list in your firewall.


Since this post I have tried using an IP address but I’m still having trouble connecting with the same error output.

I have provided a lot more information on this stackoverflow thread.

I have allowed all the inbound connections that are mentioned in the custom database in my firewall ( these IP addresses:,,,

Can you look at the stackoverflow thread and see if I’m doing something wrong from there?

Thank you.


The question you linked to shows an IP address belonging to a private address range (see This means that the Auth0 service running within a cloud/Internet environment won’t be able to reach a machine within your private network.

It needs to be an hostname or IP address in the public address space.


Yes, that was it. Thank you.