meeting-room-booking-system / mrbs-code

MRBS application code
Other
117 stars 58 forks source link

Authentication using Backdrop CMS #32

Open yorkshire-pudding opened 2 years ago

yorkshire-pudding commented 2 years ago

Is your feature request related to a problem? Please describe. Backdrop CMS (https://backdropcms.org/) is a fork from Drupal 7 and the target market is small businesses and non-profits who need more comprehensive data driven sites. The Drupal 7 MRBS module was removed many years ago as it was insecure.

I've looked at existing Auth modules, but I'm not quite sure what is required for Backdrop CMS (e.g. Joomla authentication requires no new modules on the Joomla site, just the roles).

Describe the solution you'd like For users to be able to login to MRBS using their Backdrop CMS credentials For roles for MRBS to be retrieved from Backdrop CMS For users to be able to share the session of the Backdrop CMS site to avoid having to login to MRBS if they are already logged into

Describe alternatives you've considered Alternative CMS - they don't have the same power for joining data together Separate logins - got this on existing D7 site. Not ideal for a user journey.

Additional context Add any other context or screenshots about the feature request here.

Documentation: https://docs.backdropcms.org/ Forum discussions: https://forum.backdropcms.org/forum/create-bridges and https://forum.backdropcms.org/forum/how-integrate-backdrop

campbell-m commented 2 years ago

I've had a very quick look at the Backdrop API. It looks like the global $user object will give you the currently logged in user and that the user module should allow you to get details of other users. What I don't know without more digging is how you load Backdrop from MRBS so that you get access to Backdrop globals and modules.

yorkshire-pudding commented 2 years ago

One possibility mentioned when I raised this in the backdrop community was the services module: https://github.com/backdrop-contrib/services

campbell-m commented 2 years ago

That sounds as though it would be useful if MRBS was running on a remote machine. However I doubt it would give you details of the currently logged in user. It might allow you though to avoid MRBS and Backdrop users having to have two sets of credentials and for the admins to have to manage users in two separate places.

yorkshire-pudding commented 2 years ago

Doesn't sound as helpful as I thought then. Pretty much all the use cases I can think of would have MRBS on the same server and hosting account.

yorkshire-pudding commented 1 year ago

Hi @campbell-m - I've figured this out and been able to load the current user in a test page within the MRBS folder. I would like to have a go at building this integration which I think should mostly be on the MRBS side. Please can you confirm my understanding of where I may need to add code (from the mrbs document root):

I'm happy if you want to assign me to this. Is it best to ask for support here (if needed), or is there somewhere else for developers to collaborate?

campbell-m commented 1 year ago

Yes, please, that would be great if you could add support for Backdrop. Could you add it as a Pull Request to the main branch please?

Yes, the summary above looks correct, though I think you may be working off MRBS 1.11.0 rather than the latest development code in the main branch. For example, I've moved the Joomla specific code out of Form.php where it didn't really belong.

if any other class extensions needed to go in web/lib/MRBS - should the names of these follow the class names

Yes, and if there are lots put them in a sub-directory.

I wonder whether it would be simpler just to call it 'Backdrop' rather than 'Backdropcms' to be consistent with Joomla and Wordpress? I don't know how people normally refer to it.

Is it best to ask for support here (if needed), or is there somewhere else for developers to collaborate?

You can ask for support here, email me directly or else there's an MRBS Slack workspace. May need @jberanek to add you.

yorkshire-pudding commented 1 year ago

I think it might make sense to use Backdrop and backdrop within the code. That would mirror how we code things in Backdrop but can we refer to it as Backdrop CMS in any documentation? This helps to ensure people can find it as searching for backdrop on the wider web is too vague.

Yes, I tried the latest release when troubleshooting #80 but was normally using the latest dev branch. Yes, no problem to do a PR to the main branch when I've got something to test.

Out of interest, and as I would like to think about future proofing where possible, what should I consider with regards to the roles branch? How will the roles change?

campbell-m commented 1 year ago

I think it might make sense to use Backdrop and backdrop within the code. That would mirror how we code things in Backdrop but can we refer to it as Backdrop CMS in any documentation?

OK.

Out of interest, and as I would like to think about future proofing where possible, what should I consider with regards to the roles branch? How will the roles change?

I wouldn't worry about that for the moment. There's still some thinking to be done there.