I have a question about the new customer registration. Is it possible for a customer to set (or reset) their password when clicking the account activation link?
The user flow would look like this:
User is registered (I would skip password at all, or add a random generated one)
Sorry, but I have to get back to this question. I am now implementing this logic I described above, but it looks like in the registration template I don’t have access to the user info (objectId). How exactly do you suggest I allow a user to set their password at this point (i.e. when confirming their account)?
To complete your task you should create custom confirmation page and custom API service which will set password and register user.
Workflow will be next:
You create user with specified email and some password. I recommed to register user and generate password inside of custom API service to exclude possible security problems.
Send confirmation email with link to your custom confirmation page. This page will contain form for configuring password.
When user fill password and submit form, it will call your custom API service method which will update password.
API service can be implemented in Java or in JS using Backendless SDK.
I think this approach should work for your case.
Thanks for the reply. From what you wrote, this means also disabling the “Require email confirmation” feature on the Backendless and handling confirmations (generating the custom URLs, sending the confirmation emails, checking if the password was already updated) myself, is this correct?
I think you can try to modify template for email confirmation. In template you should replace default confirmation URL by your own. In this case there will be no need to disable email confirmation.
OK, this is actually a great idea, which I was thinking about before. The question is how can I customize this URL so that I can also recognize a customer after redirection?
As I understand, the default confirmation URL is unique for that specific customer, and if I replace it in the template, I can only add a generic URL, for example, mywebsite.com/email-confirmation . But for this to work, I would need to add some parameters to identify the customer, for example, mywebsite.com/email-confirmation?objectId=xyz . Is there a way to do this?
I tried already to use the data from the default confirmation URL, which would be fine, but it doesn’t seem to be the user’s objectId.
In confirmation URL instead of user object ID used special code. It is done for security reasons since this code generated once and expired after usage.In email template identity value is available. You can form your own URL and put it instead of {confirmation_url} placeholder. You can pass identity value to your custom page as URI param and then extract it in JS and add it to submitted form data.
I just realized that passing {identity_value} through as a parameter (if I replace confirmation URL) is not great practice and it makes the email exposed. Would you guys consider adding {user_object_id} as an available value in the email confirmation templates? It would be better than passing a naked email.
We will be happy to assist you. I need to ask you a few more questions so I can understand the problem better.
Do you think that sending a letter to the mail@com address, in the body of the letter which will contain the mail@com, is unsafe?
In order for the value to be not an email, you can change it in the settings: Console - Data - SYSTEM DATA - Users - SCHEMA - TABLE EDITOR - IDENTITY.
I will also consult with the team about adding an {user_object_id} to the Confirmation Template.
Yes, in my use case (where I implement custom url for a customer to set their password), I would not want the emails exposed in the URL as a parameter. That allows any 3rd party to brute-force my URL with arbitrary emails and see if they can override the password (in my case, that might be possible if a customer account is still pending email confirmation). So passing the ObjectId would make a more secure approach for this kind of attack.
(The identity value for us still need to be an email for our users to login using their emails)
I consulted with the team and we decided to add {user_object_id} value into email confirmation templates.
I created an internal ticket - BKNDLSS-23519.
After adding, we will additionally report in this topic.
We’ve updated cloud servers with a fix for the issue you described above. We have added the opportunity to add variable {user_object_id} to the message body. Could you kindly let us know whether fix works for you well?