Override User Registration


This !!! feature allows a developer to override the default registration mechanism for users with a custom one using a Code Service. When a user uses the /api/v/1/user/reg endpoint for registration, the registration data will be sent to a admin defined Code Service for further processing and registration.

Setup Code Service for User Registration

Go to the Code tab and create a new Code Service. This service will get executed when a user call the /api/v/1/user/reg endpoint over REST. Go to the service settings and in the Requires tab enter clearblade as the dependency. Then in the Security tab, make sure the service is executable by an Anonymous user. Enter the following code and hit Save:

     systemKey: req.systemKey,
     systemSecret: req.systemSecret,
     email: req.params.email,
     password: req.params.password,
     registerUser: true,
     callback: function(err, body) {
       if(err) {
         resp.error("initialization error " + JSON.stringify(body));
       } else {
         body.options = {<YOUR_OPTIONS>};

This service will take the users credentials i.e email and password and register the user. You can add password restrictions before the init call or give your own options in the body.options JSON object which will be received by the user upon successful registration.

Setting up Authentication Override

Go into your System Settings and click the Access tab. Enter the name of the registration Code Service that you just created and hit Save

Reg Override

User Registration

The user can then use any of our SDKs to register with the ClearBlade Platform and the registration Code Service will be executed instead of the default registration logic