External validation of users on registration
-
Can we do an external validation when a user registers in FusionAuth?
For example, if user@example.com wants to register, can we first check with an endpoint in our API if this email is being used?
Is there is a way that we can use this endpoint to block that registration?
-
You can use the
user.create
or the user.registration.create
webhook to do something like this.If you enable these webhooks and configure the transaction to require the webhook to succeed, then you simply need to return a non-200 status code from the webhook to cause FusionAuth to fail this create.
https://fusionauth.io/docs/v1/tech/events-webhooks/#tenant-settings
https://fusionauth.io/docs/v1/tech/events-webhooks/events/#user-create
https://fusionauth.io/docs/v1/tech/events-webhooks/events/#user-registration-create