Skip to content

Conversation

@julien-nc
Copy link
Member

Some IdPs can't provide JSON values in token attributes.

@julien-nc julien-nc added enhancement New feature or request 3. to review labels Dec 6, 2024
Copy link
Member

@janepie janepie left a comment

Choose a reason for hiding this comment

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

Looks good :)

@julien-nc julien-nc force-pushed the enh/noid/group-provisioning-string-support branch from c95217a to c39164a Compare December 6, 2024 15:47
@julien-nc julien-nc requested a review from janepie December 6, 2024 15:47
// support values like group1,group2
if (is_string($groups)) {
$groups = explode(',', $groups);
$groups = array_filter($groups);
Copy link
Contributor

Choose a reason for hiding this comment

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

In case there is any excess whitespace in the string, maybe it would also be a good idea to use trim/mb_trim to remove them.
wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, it's now:

if (is_string($groups)) {
	$groups = explode(',', $groups);
	// remove surrounding spaces in each group
	$groups = array_map('trim', $groups);
	// remove empty strings
	$groups = array_filter($groups);
}

@julien-nc julien-nc force-pushed the enh/noid/group-provisioning-string-support branch from c39164a to 6dbe03f Compare January 20, 2025 10:20
@julien-nc julien-nc merged commit 2d40b60 into main Jan 20, 2025
45 checks passed
@julien-nc julien-nc deleted the enh/noid/group-provisioning-string-support branch January 20, 2025 10:24
@julien-nc julien-nc mentioned this pull request Jan 20, 2025
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.

4 participants