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

Allow to disable default quota, displayName, groups and email claims #883

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

julien-nc
Copy link
Member

Even if an Oidc client is configured with no attribute mapping for quota, email, displayName or groups, those claims are included by default.

This allows using a global config switch (in config.php) to disable those default claims and only use them if a mapping is set in the client's settings (user_oidc's admin settings).

Default claims are enabled by default (to not break existing setups).

@julien-nc julien-nc added enhancement New feature or request 3. to review labels Jun 17, 2024
@julien-nc julien-nc requested review from juliusknorr and artonge June 17, 2024 14:27
// by default: default claims are ENABLED
// default claims are historically for quota, email, displayName and groups
$isDefaultClaimsEnabled = !isset($oidcSystemConfig['enable_default_claims'])
|| in_array($oidcSystemConfig['enable_default_claims'], [true, 'true', 1, '1'], true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can be stricter and only disable default claims if enable_default_claims => false. Just to ease our life.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better like this?

$isDefaultClaimsEnabled = !isset($oidcSystemConfig['enable_default_claims']) 
    || $oidcSystemConfig['enable_default_claims'] !== false;

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@julien-nc julien-nc force-pushed the enh/allow-disabling-default-claims branch from d5047f1 to 8c58113 Compare June 20, 2024 09:21
@julien-nc julien-nc merged commit 8527d46 into main Jun 21, 2024
38 checks passed
@julien-nc julien-nc deleted the enh/allow-disabling-default-claims branch June 21, 2024 08:10
@julien-nc julien-nc mentioned this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants