fusionauth-issues icon indicating copy to clipboard operation
fusionauth-issues copied to clipboard

Add Tenant and Application to Self-Service Registration Validation Lambda

Open tneylan1 opened this issue 1 year ago • 2 comments

Add Tenant and Application to Self-Service Registration Validation Lambda

Problem

We are attempting to validate a new user registration using the "Self-service registration validation" lambda, which makes a call into our own API. The API needs to know what tenant and application the user is registering for, and additional information from the tenant (like an API key). The current parameters to the validation lambda to not support this. ApplicationId is a property of the registration parameter, but never has a value. And tenant is not accessible at all.

Solution

We would like tenant and application to be added to the "Self-service registration validation" lambda's parameters. All of the properties of these objects should be available, including "data". They can be separate parameters, or properties of "context".

Alternatives/workarounds

Have a separate validation lambda for each tenant/application combination, with all of the properties that we need hard-coded, including our API key. Our implementation requires a separate Tenant for each of our customers, thus, we’ll have 400-500 Tenants which isn’t a very maintainable workaround for us.

Another alternative would be to add a hidden field to your registration with the client Id and then use a lambda HTTP connect call (assuming you have an Essentials or Enterprise license) to make a request to the API to get the application and tenant data.

Additional context

N/A

Community guidelines

All issues filed in this repository must abide by the FusionAuth community guidelines.

How to vote

Please give us a thumbs up or thumbs down as a reaction to help us prioritize this feature. Feel free to comment if you have a particular need or comment on how this feature should work.

tneylan1 avatar Aug 26 '24 20:08 tneylan1

Hmmm. Confirmed that we don't have the application Id in the registration object, probably because it is not yet saved while the lambda isn't executing.

mooreds avatar Aug 26 '24 21:08 mooreds

Added another workaround. Thanks for filing this request @tneylan1 . Unfortunately we have a backlog of work, but when we revisit this lambda, we'll see what makes sense.

mooreds avatar Sep 23 '24 22:09 mooreds