Can I authenticate with a URL and unique query key

Joao Coutinho:
Hello Everyone. Does FMBetterforms have a way to allow users to login with and token sent by email? I don’t know the exact term for that, but basically, the user only enters the email on the site and receives by email a link to directly access the site without a password.


Delfs:
Yes and no.
Basically you can use a smart link for authentication ( know who your user is ) but this does not enables BF’s built in authentication. Instead, you will have to ‘monitor’ your user in your hooks.

Overview:
FMS generates and emails a url with a query like [myapp.fmbetterforms.com/#/?token=123-123-123](http://myapp.fmbetterforms.com/#/?token=123-123-123)

BF loads this landing page and in the of form request you check the query token for validity
$token = jasonGetElement($$BF_Query ; "token")

If it is valid you drop a cookie in the browser with the token value and usually a short expire time.

In all calls after you just check for a valid token ( Cookie ) and if it is not valid, you use a path action to redirect the user.

The whole things is about an extra 5-8 lines of FMS code!


1 Like