bepolytech / ULBDiscordBot

Discord bot to verify a user's ULB studentship
https://hub.docker.com/r/bepolytech/ulbdiscordbot
GNU General Public License v3.0
4 stars 1 forks source link

Change auth to ULB's CAS/SAML #35

Open LucasPlacentino opened 9 months ago

LucasPlacentino commented 9 months ago

similarly to DocHub
(see https://github.com/DocHub-ULB/DocHub/blob/main/users/authBackend.py for example implementation)

I asked the ULB IT staff about it and we can get access for it, and it could include some information about the student (like name and surname, faculty, and student-status)

OscarVsp commented 9 months ago

Would be nice ! I will have a look at the DocHub implementation.

This would mean that we could include restrictions based on the faculty also ?

OscarVsp commented 9 months ago

I think we should make a proper database first (like not a Google spreadsheet) before accessing (and potentially storing) more students data. I may have someone willing to help us with that.

LucasPlacentino commented 9 months ago

This would mean that we could include restrictions based on the faculty also ?

I'm not sure, maybe

I think we should make a proper database first (like not a Google spreadsheet) before accessing (and potentially storing) more students data. I may have someone willing to help us with that.

Yes! I also wonder if the IT staff can host a db for us at their on-prem. It would resolve some of the problems we keep having when self-hosting

LucasPlacentino commented 9 months ago

see their PR that implements it: https://github.com/DocHub-ULB/DocHub/pull/192

⚠️ DocHub licensed under an AGPL-v3, we need to take this into consideration if we use their implementation

LucasPlacentino commented 9 months ago

here's a quick idea of a (flask?) website to link the accounts: https://codepen.io/lucasplacentino/full/QWYYVwB

The registration flow would be: Connect to website using ULB CAS -> Button to connect to Discord account via OAuth -> Backend links the username and ulb email address in db (maybe other info too?) -> Bot adds roles in the servers they're in

Users should be able to unlink their Discord by themselves (so it should remove their roles in all servers and remove their discord_username entry in the db) . It would also be nice (GDPR-wise) to allow users to completely remove themselves from the db (and remove roles etc, or ask first to unlink their account).

LucasPlacentino commented 7 months ago

See: https://github.com/LucasPlacentino/cas-sso-discord-bot and https://github.com/bepolytech/quidam-ulb-bot

Do we want to release it in this repo as a v2 or in a new repo as a new project?