Login create 401 error

We are currently trying to implement auth0 into an existing ASP website. I am working on the Database Action Scripts on the website and using the “Save and Try” button attempting to login to an existing AWS database. I think I have the connection configuration worked out as I am not receiving the “can not connect to server…” any longer.

The problem I am running into now is, I get a message the login failed . The console says its a 401 error. Do I need to pass a token or something that give me authorization to do this?

Hi @gwhitcher,

Thanks for reaching out to the Auth0 Community!

I have just searched through your tenant logs for a 401 error, but could not find one. Could you please provide me with more context on the error you experienced?

One way to do this is to use the Real-time Webtask Logs Extension to monitor the console log error messages.

I look forward to your update.


Hi Rueben

It looks like the user connection is set to Username-Password. instead of the new connection I made. In trying to recreate that user, I get an error stating that the connection is disabled. I do not see anywhere that shows it being disabled or a place where I can enable it.

I set a token but that didn’t seem to enable it

Hi @gwhitcher,

Thanks for the update!

When I look at your custom database settings, I see that it has not yet been enabled for any connections.

When testing the connection, you must enable at least one application.

You can do this by going to your Auth0 Dashboard > Authentication > Database > Your Custom Database Connection > Applications tab. On there, you can toggle on this connection for your applications.

This should fix the “Connection is disabled” error you experienced.

Please let me know how it goes.


Well, it did change the error. It is now returning:

Error!Sandbox Error: Failed to connect to localhost:1433 - connect ECONNREFUSED

The database connection information is in the Database Action Scripts. It is set to our database location so I am not sure as to why its looking at localhost:1433

Hi @gwhitcher,

Thanks for following up.

The error you shared indicates that you are trying to connect to localhost as your server.

Have you made sure that the server is pointing to the correct location?

And could you also please make sure that your configuration values are correct as well?


I changed the server to use the public Ip address, username and password directly instead of using the configuration and the error says it can not connect to that ip. It is on an AWS server and I am starting to think the connection issue resides on the AWS side of things. I added the ip addresses the website said should be added to the incoming rules for that server on port 1433, but still get this error.

Not sure what else to do to get this connected.

Looks like there is a process in AWS to setup so Okta can reach it. I have done that and am trying to figure out how to add the AWS Account Federation app to Integrations. The documentation says its under Applications but I do not see that.