zorn-v / nextcloud-social-login

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

Programmatically adding group mappings to Custom OpenID Connect #441

Closed PatrickTOToole closed 6 months ago

PatrickTOToole commented 6 months ago

I was wondering if it is possible to update the group mappings via an api call. It seems that currently there is a POST request to /apps/sociallogin/settings/save-admin but it requires a cookie and access token. I was wondering if there were any webDav or restful apis to edit these mappings.

zorn-v commented 6 months ago

Actually there is api for setting config values https://github.com/zorn-v/nextcloud-social-login/blob/fbf73827a7223f1441ea19ab89220ab9568d5475/lib/Controller/ApiController.php#L29

In your case it should be like curl -d'key=custom_providers&config=YOUR_JSON_GOES_HERE' http://login:password@nc.domain/apps/sociallogin/api/config

Config keys and values you can check in oc_appconfig table with appid = 'sociallogin'

PatrickTOToole commented 6 months ago

Oh that's great thank you. Just looked into it. Another related question, has the plugin been tested with a high number of groups? (potentially in the hundreds)

PatrickTOToole commented 6 months ago

And is there an api to retrieve the config?

zorn-v commented 6 months ago

has the plugin been tested with a high number of groups? (potentially in the hundreds)

I don't know. It is related to nextcloud I think.

And is there an api to retrieve the config?

Not yet

PatrickTOToole commented 6 months ago

Ok, thank you for your responsiveness and help. Closing the ticket