Automatic migration only works if password is reset

Hi all, thanks for taking the time to read. Just a heads up, I might be posting more questions in the very near future as I’m trying to migrate our entire auth flow out of the application into auth0!

I’m trying to leverage custom database connections to automatically migrate our users into auth0. Setup was pretty easy, but it seems to not be entirely there.

Hitting Try for both my Login and Get User scripts under the custom database tab work perfectly; however, when I Try Connection, I’m getting a “Wrong email or password” every time. I found a couple of other related issue and one that did help was changing my default directory to the custom connection name, but it seems it’ still not completely working. The reason I say it helped is because if I go through the “Forgot password” flow for a known user in my database, the entire flow works: I get the email, I can go into the link and reset the password for that user. Then if I try logging in again inside Try Connection that user succeeds in logging in and is subsequently populated under the users option in my tenant.

Given it’s my first post, apologies if I’m breaking some sort of rule / not providing enough information. I’m fully heads down on this for a while though, so I will reply as soon as I see any additional request from me!

Thank you

Hi @mclslee

First thing to try is the “Real Time Webtask Logs” extension and console.log statements in your scripts:

This will give you some debugging info to figure out what is going on.

John

Hi @john.gateley, thanks for the resource, good tool to be aware of! I installed it and here are some screenshots for the script → output and behavior

Script:

Behavior:

Log:

I did find in the documentation:

So I’m now wondering maybe it’s not allowed for me? I’m a free user right now but have 20 days remaining to “experiment with features that are not in the Free plan,” and I’m interpreting that as having access to this feature

So if I understand right, the scripts appear to be working: they validate the password is correct.

But the ULP is still displaying an error.

Correct?

Check your tenant logs, is there anything there?
And open developer tools, see if there is anything there…

John

Hi again @john.gateley

The logs helped! I was returning the id: int primary key as user_id, but we also have a unique character varying field that will suffice as that, so returning that instead makes it all happy. Though I’m not quite sure why after resetting a user’s password it worked, but I’m happy enough to move on haha.

Thank you!

PS. Would it be beneficial for others going forward to document that user_id in the object passed in to the callback function cannot be an int?

1 Like

Thanks for providing that feedback, I’ll make sure to relay it to our docs team!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.