Hello, here.
There is a “pre-user-registration” trigger and a “Domain Based Registration” action.
When I attempt to add additional domains (my domain list is quite long), I encounter the error “invalid InstalledIntegration.Configuration[0]: embedded message failed validation | caused by: invalid NameValue.Value: value length must be between 0 and 2048 runes, inclusive”.
It seems there may be limitations in place.
Is it possible to resolve this issue or find a workaround?
Thanks,
Serhii
Hi @serhii.holub
Welcome back to the Auth0 Community!
Thank you for posting your question. You can try to use an Action instead of the plug-and-play action from the marketplace. You can find more related resources about that in this Knowledge Solution → Users are registering with email domains that we don't want to allow
I’m also sharing a small code snippet that would allow you to register from a allowedDomain list,
exports.onExecutePreUserRegistration = async (event, api) => {
const allowedDomains = ['example.com',]; // Add your allow domains here
// Extract the domain from the user's email
const domain = event.user.email.split('@')[1].toLowerCase();
// Check if the domain is in the allow list
if (!allowedDomains.includes(domain)) {
api.access.deny(`domain_not_allowed`,`Registration from domain ${domain} is not allowed.`);
}
};
Thanks
Dawid