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

Add missing configuration key in UpsertProvider (add provider via command) #1063

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sudo -u www-data php /var/www/nextcloud/occ user_oidc:provider demoprovider --cl
--clientsecret="lbXy***********" --discoveryuri="https://accounts.example.com/openid-configuration"
```

Attribute mappings can be optionally specified. For more details refer to `occ user_oidc:provider --help`.
Other options like attribute mappings or group provisioning can be optionally specified. For more details refer to `occ user_oidc:provider --help`.

To delete a provider, use:
```
Expand Down Expand Up @@ -274,6 +274,21 @@ it is possible to disable the classic "self-encoded" validation:
],
```

### Group provisioning

You can configure each provider:
* Toggle group provisioning (creates nonexisting groups on login)
* Set the group whitelist regular expression (nonmatching groups will be kept untouched)
* Toggle login restriction to people who don't belong to any whitelisted group

This can be done in the graphical settings, in the "OpenID Connect" admin settings section or with the occ command to create/update providers:

```
sudo -u www-data php /var/www/nextcloud/occ user_oidc:provider demoprovider \
--clientid="..." --clientsecret="***" --discoveryuri="..." \
--group-provisioning=1 --group-whitelist-regex='/<regex>/' --group-restrict-login-to-whitelist=1
```

### Disable audience and azp checks

The `audience` and `azp` token claims will be checked when validating a login or bearer ID token.
Expand Down
8 changes: 8 additions & 0 deletions lib/Command/UpsertProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ class UpsertProvider extends Base {
'shortcut' => null, 'mode' => InputOption::VALUE_REQUIRED, 'setting_key' => ProviderService::SETTING_GROUP_PROVISIONING,
'description' => 'Flag to toggle group provisioning. 1 to enable, 0 to disable (default)',
],
'group-whitelist-regex' => [
'shortcut' => null, 'mode' => InputOption::VALUE_REQUIRED, 'setting_key' => ProviderService::SETTING_GROUP_WHITELIST_REGEX,
'description' => 'Group whitelist regex',
],
'group-restrict-login-to-whitelist' => [
'shortcut' => null, 'mode' => InputOption::VALUE_REQUIRED, 'setting_key' => ProviderService::SETTING_RESTRICT_LOGIN_TO_GROUPS,
'description' => 'Restrict login for users that are not in any whitelisted groups. 1 to enable, 0 to disable (default)',
],
'mapping-groups' => [
'shortcut' => null, 'mode' => InputOption::VALUE_REQUIRED, 'setting_key' => ProviderService::SETTING_MAPPING_GROUPS,
'description' => 'Attribute mapping of the groups',
Expand Down
Loading