Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perform "Update Provider" function via occ command #858

Closed
jmulaaaa opened this issue May 7, 2024 · 3 comments · Fixed by #860
Closed

Perform "Update Provider" function via occ command #858

jmulaaaa opened this issue May 7, 2024 · 3 comments · Fixed by #860
Labels
bug Something isn't working

Comments

@jmulaaaa
Copy link

jmulaaaa commented May 7, 2024

Description

I have a script that runs on nextcloud startup to perform configuration commands via occ. I have everything setup for user_oidc. The issue I am having is if I just run the commands and try to log in my group mapping is giving me unique identifiers.

Current Solution

All I do to resolve this issue right now is open the UI settings and simply press update provider. I am not changing any options. I understand why this is the case, I just wish there was a "Update" or "Test" configuration command that could perform this same functionality easily via OCC command.

Current Setup Commands:

php occ app:enable user_oidc
php occ user_oidc:provider "Example SSO" --clientid="${OPENID_CLIENT}" --clientsecret="${OPENID_SECRET}" --discoveryuri="${OPENID_URL}" --mapping-uid=oid --mapping-groups=groups
php occ config:app:set --value 1 user_oidc provider-1-groupProvisioning
php occ config:system:set user_oidc single_logout --value false --type=boolean
@jmulaaaa
Copy link
Author

jmulaaaa commented May 7, 2024

I should also add, I know this can be done via API. I would really prefer to not have to use the api.

@julien-nc
Copy link
Member

julien-nc commented May 7, 2024

Thanks for reporting this. The unique-uid value is True by default so this is expected if you don't add --unique-uid 0 to occ user_oidc:provider when creating the provider.
And there actually is a bug in the settings web page. The default value for unique-uid is not correct so as it's not defined, when you update the provider, it sets it to False.
I'm fixing this. PR coming soon.
In the meantime, just explicitly defining the value for unique-uid in the occ command to create the provider will solve your issue.

@julien-nc julien-nc added the bug Something isn't working label May 7, 2024
@jmulaaaa
Copy link
Author

jmulaaaa commented May 7, 2024

I appreciate the response. Explicitly defining the value did work for now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants