Pre-user-registration, when is optional event.client not defined?

Hi,

depending on the client initiating a new user’s registration, we want to execute some logic in the pre-user-registration flow.
However the docs say that event.client is optional.
In what cases is event.client not defined? I could not find any documentation about this. I thought every registration must be initiated by a client?

Another question popped up:
Is it possible to access the registering client in a post-user-registration action? My current approach would be to save the client in a pre-user-registration action in the user’s metadata and then try to access it in a post-user-registration-action.

Thanks!

Hi @julian2,

Welcome to the Auth0 Community!

I understand you have questions about using the Pre-User Registration Action.

Firstly, the event.client object is always defined in a Pre-User Registration Action. However, I should emphasize that users can be created in a few ways, namely:

  1. The Authentication API Signup Endpoint
  2. The Management API Create a User Endpoint
  3. Auth0 Dashboard User Management Interface

Among these methods, only the Authentication API Signup endpoint requires the client_id when creating users.

In the Management API and Auth0 Dashboard, there is no requirement for specifying the client_id, therefore this will populate with default values configured on your tenant.

Specifically, the Management API will use the default M2M application named API Explorer Application, and the Auth0 Dashboard user management interface will use the global application on your tenant named “All Applications”. Your global application client id can be found on your Auth0 Dashboard Settings > Advanced > Global Client Information.

I hope this answers your questions.

Please let me know if there’s anything else I can do to help.

Thanks,
Rueben

1 Like

Hi Rueben,

you answered my question perfectly, thank you for the detailed explanation!

Best regards,

Julian

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