Nextcloud user_saml settings stored

Hello,
I’m trying to fully automate the installation & setup of Nextcloud.

I’ve successfully done what i wanted, except for the following :
I’m using the official extension user_saml and i’m trying to automate the following page :

Looking at the code, it seem like this part correspond to the 2 buttons and this and that ones are what happen on click.

My question is the following : Where do OCP.AppConfig.setValue store it’s values ?
I’ve looked into the PostgreSQL tables managed by the extension to no avail.
I believe it’s stored in a file, but no certitude…

Thanks for any help !

In the end, it is stored in the table oc_appconfig in the database.

Chris

1 Like

All system (and app values) can be set via occ config if you wish to script things.

In addition, many apps (such as user_saml) have their own commands for doing various things. See the command namespace for occ saml.

Thanks a lot !
I, indeed, did not search the common Nextcloud tables as there was too many of them :sweat_smile:.

It seem like i stopped my search too soon :upside_down_face:

1 Like

Yes, this is what i do on the nextcloud-aio-mastercontainer to config the SAML :

docker exec --user www-data nextcloud-aio-nextcloud php occ app:install user_saml
docker exec --user www-data nextcloud-aio-nextcloud php occ saml:config:set \
    --general-idp0_display_name="Synology" \
    --general-uid_mapping="account" \
    --idp-entityId="$SALM_SYNOLOGY_SERVICE__IDP_ID" \
    --idp-singleSignOnService.url="$SALM_SYNOLOGY_SERVICE__IDP_SSO_URL" \
    --idp-x509cert="$SALM_SYNOLOGY_SERVICE__CERTIFICATE" \
    --sp-name-id-format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" \
    --saml-attribute-mapping-displayName_mapping="username" \
    --saml-attribute-mapping-email_mapping="email" \
    $(docker exec --user www-data nextcloud-aio-nextcloud php occ saml:config:create | xargs)

Thanks to @christianlupus’s solution, i’m gonna append in some sort of form the following :

psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@nextcloud-aio-database/$POSTGRES_DB" -c "INSERT INTO oc_appconfig (appid, configkey, configvalue, type, lazy) VALUES ('user_saml', 'type', 'saml', 2, 0) ON CONFLICT (appid, configkey) DO UPDATE SET configvalue = 'saml'"