ualbertalib / library-cms

Content Management System for the UofA Libraries website. Built on Comfy Mexican Sofa.
2 stars 0 forks source link

Adding role-based authentication #551

Open pgwillia opened 8 months ago

pgwillia commented 8 months ago

Currently, we're using basic authentication with a single username and password.

https://github.com/ualbertalib/library-cms/blob/712fdaa848fa87311417536d9e2a2f961305414e/app/controllers/profiles_controller.rb#L37

We would prefer having role-based authentication where we can audit changes and manage access.

murny commented 3 months ago

Have some questions for this work:

My guess is we want Ualberta login via SAML (but maybe the MVP just has a simple authentication via our own sign in page), we don't have a requirement for roles, we probably require some UI screens in the admin area to manage our users. Such as being able to view users, invite users, disable users, etc. Later on this can be expanded to offer audit trials of user actions etc.

But looking for feedback on the requirements for this story.

Have any thoughts about this @nnunn?

nnunn commented 3 months ago

Sorry it's taken me so long to reply!

Roles: A generic Admin role is sufficient.

I would prefer SAML with ualberta login if possible, and yes we would need some UI screens to approve and manage users.

I'm not sure if this is in scope, but there has been some interest in having some areas of the UAL website (specifically staffhub) password protected so that only staff can access them.

murny commented 3 months ago

Thanks for the feedback and requirements.

I'm not sure if this is in scope, but there has been some interest in having some areas of the UAL website (specifically staffhub) password protected so that only staff can access them.

Sounds like password protecting specific pages is more than doable. Sounds like you can put them under a certain path and then have that path requires login: https://github.com/comfy/comfortable-mexican-sofa/wiki/HowTo:-Password-protecting-pages

So could have a path like anything under https://www.library.ualberta.ca/secret/* could require login (have to log into your Admin account, or make this just generic basic Auth or something). Then assign pages under this path to "protect" them. So think this is more than doable and could definitely be in scope.

Roles: A generic Admin role is sufficient.

I would prefer SAML with ualberta login if possible, and yes we would need some UI screens to approve and manage users.

Awesome!

My plan for this since I only have a couple of weeks to work on this (from now until middle of August, I'm planning on fixing up the CSS/JS assets and Webpacker migration work. Then from middle of August until end of August I plan to work on this Authentication project) will be the following:

Then we need to figure out how to provision admins? Initial admins are done inside Rails console? Then after that are they invited by an existing admin (needs email)? Or do they sign up and an admin approves them? Or another way?