I have several tenants with custom database connections where I have implemented the Create script and I haven’t implemented the Get User script and it was working fine and users were able to sign out to my apps. Now I have just added a new custom db connection and implemented the Create Script but with this new one, when user tries to sign out it fails saying that I need to implement BOTH Create and Get User scripts. Why is that? and Why it was not needed before? Is there a recent change around this?
Hi @rsanchez1,
Can you post the actual error message? I’m not sure if something changed, but possibly logout is calling GetUser. The docs state:
The Get User script implements the function executed to determine the current state of existence of a user.
Which seems a bit vague to me but may indicate that GetUser is getting called when you call /logout
.
Sure, the detailed error message is as follows:
Occurred
4 days ago at 2020-12-04 05:05:33.401 UTC
Type
Failed Signup
Description
Please implement the Get User script for this database connection at https://manage.auth0.com/#/connections/database
Connection
MyCustomDB
Application
My APP myAppClientId
User
Something important to clarify is that the problem is not when logout, it is when sign out a new user (attempt to create a new user)
No, it is disabled. What is this flag for?
Enabling that flag imports users from your own database into an Auth0 hosted database. If that flag is enabled then the GetUser script is mandatory. Otherwise, it should not be required, unless the requirements have changed and the documentation has not been updated.
I got information from the support ticket and this is the information they gave me:
I believe this might be due to a recent issue in the Auth0 Dashboard where saving any field in the dashboard for this connection creates all the scripts for the Custom DB, whereas before it behaved in a way where the script wasn’t created until you specifically saved that script. A fix for this is currently in the Engineering teams backlog.
If you are wanting to remove the ‘Get User’ script for this connection, you can PATCH the CustomDB by using “Update a connection” (Auth0 Management API v2 ) with all the fields except for the scripts you do not want. I’d suggest using the “Get a Connection” (Auth0 Management API v2 ) endpoint first to ensure you’re not changing any other values. I also suggest you test this out on a dev tenant first to ensure you’re performing this action correctly and not removing any required values.
I have been able to resolved the issue by using the PATCH call they suggested.
Perfect! Thanks for sharing it with the rest of community!
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.