How to setup user signon authentication in Mochiweb?

144 Views Asked by At

It appears that erlang's mochiweb does not have any configuration that allows to setup a logon redirect user authentication. How could this be implemented ?

1

There are 1 best solutions below

0
Masse On

Mochiweb is a low-level library and as such it doesn't have any authentication/authorization layer out of the box. You need to implement such functionality by yourself.

There is a lot to take into consideration when implementing such system by yourself, but take a look at this answer

To simplify things a bit, you can third party log-in services such as persona. Even if you use third party services you still need a persistence layer where you save at least a list of registered users and a way to get information from forms or javascript. Check out this tutorial on how to access request information. For the persistence, erlang comes with ets/dets and mnesia so that you don't need to install any extra software, at least at the beginning.