I’ve been through all the tutorials in the documentation. I find them very interesting but also very basic and they don’t help much when you want to do something more complex. In addition there are only 3-4 videos o_0 which is insufficient for a fully understanding of Enonic. I haven’t found any information about how to create a front end login page and I would appreciate some help. What’s the best approach? How do I create a users database? Do I have to use Enonic storage system or should I use a different type of database as SQL and integrate it into Enonic?
Thanks for reaching out!
You are right, docs on authentication and friends is not good enough, but it will be better soon!
In the meantime, I can try to help you out here:
Enonic XP has a concept called userstores and idproviders. Create a userstore and assign an idprovider to it. Idproviders are essentially apps designed to handle authentication and everything related to users. Internally XP only understands “users/groups/roles” that are created within the userstore concept.
There are already several idprovider apps on Enonic Market:
How does this work? The essential idea is separation of concern so you don’t need to deal with authentication and user handling in your app/site, and leave this functionality to an idprovider. Idproviders are mapped to your solution through virtualhosts. Each vhost has a dedicated idprovider that will be triggered when required. I.e. when app throws a 401 error (auth required).
For users there is also a concept called profiles, that allow you to extend users with custom attributes as required.
To answer you question specifically. The best approach is simply to use an existing idprovider (or implement your own if none of the existing fit your requirements). Idproviders may act as “cache” for external systems such as LDAP - or it may handle everything locally like the SimpleIDprovider does.
Finally, you may also “hardcode” authentcation directly into your app, skipping idproviders - but this would only make sense for special requirements.