Custom database connection stops working when enabling automatic user migration

I set up a custom database connection and wrote the login and get user scripts. I tried them out and they ran successfully. Then I used the “Try Connection” feature. This also worked.

Now when I enable the Automatic migration option in this custom db connection. The “Try connection” returns “Wrong email or password”. Same result in our asp.net mvc application.

To be clear, the goal is to gradually migrate our existing users (now in sql server) to Auth0.
So: Automatic migration enabled = try connection doesn’t work anymore.

Hi @jan.vanhoye

Turn on the realtime webtask log extension and put some console.log statements in.
That should help.

At a guess, you are entering an email that exists in Auth0 so the script is not being invoked.

John

1 Like

Hi @john.gateley

Where exactly do you want me to put the log statements? The login and get user scripts are working as expected. The email already existing in Auth0 is also not the case. The logging when executing the try connection while automatic migration is turned on looks like this:

Anything else we might have been missing?

Hi @jan.vanhoye

Something is different when you do “try connection” vs using the connection from an application sign-in, right? Put in some log statements to try to figure out what is different, why it works in the one scenario but not the other. Run both scenarios and do a side by side comparison of the log output.

John

1 Like

Hi @john.gateley

No there is not :slight_smile:
On enabling the “import userst to Auth0” setting of my custom db, the try connection functionality stops working. The logging looks identical. When turning the option off, everything works as expected. I’m sure to use new users everytime I test. (so they don’t already exist in auth0).

Thanks for the support
Jan

Hi @jan.vanhoye

Can you try with import uses turned on, but using a real application instead of the “try connection”?

What is the error in the tenant logs when using “Try Connection” and import users turned on?

John

1 Like

Hey @john.gateley

When I use the “Try Connection” function or a real application, the logging is identical. I do not see errors. In fact it logs the following: State change: SentClientRequest → LoggedIn
This is not in line with what I see in the login screen. There I get: Wrong email or password.

How can I debug this issue?

Jan

@john.gateley @jan.vanhoye any solutions to this. Running into the same issue :frowning:

I had the same issue. Looking at the logs it turned out that I send the mfa phone number in the wrong format (international numbers had the leading double zeros instead of +). Turns out the login/getuser script tests are not validating the data.

Maybe this helps someone else along the way :slight_smile: