nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.72k stars 4k forks source link

Allow to register instances of IAlternativeLogin #25060

Closed zorn-v closed 3 years ago

zorn-v commented 3 years ago

In social login app may be many alternative logins with no determined parameters or even names, so it is impossible to just create "class" for all providers.

ChristophWurst commented 3 years ago

could you point me to the code please?

the problem with objects (class instances) as opposed to class names is that objects are very heavy and the registration happens on every single request while the alternative login is only required for any request that actually handles login, right?

I'm wondering if it would be possible to register a proxy class that then delegates to your real implementations …

zorn-v commented 3 years ago

I did not find a way to dynamic pass parameters in "container". I get all alternative logins from app settings so it is not "static" (known) info. Check https://github.com/zorn-v/nextcloud-social-login/blob/dc76af81d44b10eca273f04ae35b1993d2e1fe10/lib/AppInfo/Application.php#L91-L95

zorn-v commented 3 years ago

that objects are very heavy and the registration happens on every single request

In my case I do it only on login page.