- Issue created by @aleix
- πΊπΈUnited States wells Seattle, WA
Interesting. This definitely sounds like a use case worth supporting but I'm not familiar with derivatives. I'll do some ready but would also be happy to take advice and/or a PR here if you have any thoughts on how a specific approach might look.
- πͺπΈSpain aleix
Hi again wells, I have good news. After testing in my social_auth_nextcloud β module just one thing is left to be done by now in social_auth module. Apart from this, all code must live in integration code. The only change is to prevent colons in config id in SocialAuthSettingsForm. I explain it below.
The code change to be done in integrations that wants to gain derivative capabilities can be seen in this commit . It is a simple implementation of how a the derivative plugin could be done.
Doing as this it will derivate Network plugin and Tasks so their resulting derivate plugins come from the value of simple "social_auth_nextcloud_instances" array defined in main settings.php, such as:
$settings['social_auth_nextcloud_instances'] = [ "nextcloud.example.org", "nuvo.example.org", ];
I did it using this simple array in settings.php to illustrate how this must be done without oversizing the code, but i am planning an auxiliary config entity along with their forms to let user set the allowed social auth nextcloud instances from UI.
One of the critical things to be aware of is that config id must be rewritten because id's cannot use colons, and as config id is obtained from pluginId and derivative plugins adds ":" in plugin ids, their ids must be replaced in settings form (i did a replace from ":" to "."). As the integration must extend the SocialAuthSettingsForm form to add the "url" field, the config id to be get or to be set could be overridden there, but as parent submit is also called in when extending social auth settings form, it needs to be replaced in SocialAuthSettingsForm also (hence the patch that I had attach in social_auth #3360455 issue β¨ Derivative network plugins Fixed ).
I'll create some automated tests in social_auth_nextcloud β , but it is working well in my manual tests.
- Status changed to Needs review
over 1 year ago 1:36pm 16 May 2023 - πͺπΈSpain aleix
Finally https://www.drupal.org/project/social_auth_nextcloud β is released right now, still depending on social_auth patch in https://www.drupal.org/project/social_auth/issues/3360455 β¨ Derivative network plugins Fixed to make it work. but anyway this is working fine, and passing functional tests (for block and settings).
If anyone interested, here are the basic changes to be done if multiple derivatives of an integration is wanted: https://git.drupalcode.org/project/social_auth_nextcloud/-/compare/ec128...
Could this be added to integrations in the list of social_auth 4.x implementers ?
Obviously review of the module is really appreciated.
- Status changed to Fixed
over 1 year ago 6:12pm 16 May 2023 - πΊπΈUnited States wells Seattle, WA
Congrats! I have added Social Auth Nextcloud to list of 4.0.x implementors over on the Social Auth project page.
I'm gonna close this issue and we'll track the ongoing work in β¨ Derivative network plugins Fixed .
Automatically closed - issue fixed for 2 weeks with no activity.