zorn-v / nextcloud-social-login

GNU Affero General Public License v3.0
198 stars 137 forks source link

make all users log in via discourse #325

Closed tobiaseigen closed 1 year ago

tobiaseigen commented 2 years ago

Hello! Thanks for the great work you've been doing on social login app, and especially that you've now made it possible to fairly easily enable discourse as authentication provider. I'd love to see more communities and small teams using discourse and nextcloud together, and would like to use it this way personally with my Discourse for Teams site. I work for discourse.org as product manager for the Discourse for Teams product.

I've been getting some great help from @paroga over on meta.discourse.org where I listed my current challenges (thank you!) but thought I'd reach out here so we can talk directly about how discourse can be set up properly as the primary authentication provider for nextcloud, using the social login app. I'd appreciate any guidance and am happy to help with testing any improvements that are made along the way.

I've got the integration set up and working for myself, but have a few issues still. The most important one is that I'd like to have users only ever log in via discourse, including existing users who already have accounts in both discourse and nextcloud. I see there is a setting for "Allow users to connect social logins with their account" but I want to make this the default and make everyone use it always, without having to go and set it up themselves. I looked at user settings via the CLI but am not seeing the setting I need to change for the existing users. Is it possible?

paroga commented 2 years ago

IMO your issue is independent of the used provider. The problem is that there is not clean way to automatically map social logins to existing users.

What about adding a new option, which would allow finding an existing user by email (if there is only one) during login?

tobiaseigen commented 2 years ago

Yes, you've about summed it up! That would entirely solve my problem.

zorn-v commented 2 years ago

The problem is that there is not clean way to automatically map social logins to existing users.

There is 2 api ocs methods for it. https://github.com/zorn-v/nextcloud-social-login/blob/master/appinfo/routes.php#L19 https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-api-overview.html