@@ -62,9 +62,9 @@ public function hasOidcUserProvisitioned(string $userId): bool {
6262
6363 /**
6464 * Resolves a claim path like "custom.nickname" or multiple alternatives separated by "|".
65- * Returns the first found string value, or null if none could be resolved.
65+ * Returns the first found value, or null if none could be resolved.
6666 */
67- public function getClaimValue (object |array $ tokenPayload , string $ claimPath , int $ providerId ): mixed {
67+ public function getClaimValues (object |array $ tokenPayload , string $ claimPath , int $ providerId ): mixed {
6868 if ($ claimPath === '' ) {
6969 return null ;
7070 }
@@ -99,14 +99,21 @@ public function getClaimValue(object|array $tokenPayload, string $claimPath, int
9999 }
100100 }
101101
102- if (is_string ($ value )) {
103- return $ value ;
104- }
102+ return $ value ;
105103 }
106104
107105 return null ;
108106 }
109107
108+ /**
109+ * Resolves a claim path like "custom.nickname" or multiple alternatives separated by "|".
110+ * Returns the first found string value, or null if none could be resolved.
111+ */
112+ public function getClaimValue (object |array $ tokenPayload , string $ claimPath , int $ providerId ): mixed {
113+ $ value = $ this ->getClaimValues ($ tokenPayload , $ claimPath , $ providerId );
114+ return is_string ($ value ) ? $ value : null ;
115+ }
116+
110117 /**
111118 * @param string $tokenUserId
112119 * @param int $providerId
@@ -523,7 +530,7 @@ private function setUserAvatar(string $userId, string $avatarAttribute): void {
523530
524531 public function getSyncGroupsOfToken (int $ providerId , object $ idTokenPayload ) {
525532 $ groupsAttribute = $ this ->providerService ->getSetting ($ providerId , ProviderService::SETTING_MAPPING_GROUPS , 'groups ' );
526- $ groupsData = $ idTokenPayload ->{ $ groupsAttribute} ?? null ;
533+ $ groupsData = $ this -> getClaimValues ( $ idTokenPayload , $ groupsAttribute, $ providerId ) ;
527534
528535 $ groupsWhitelistRegex = $ this ->getGroupWhitelistRegex ($ providerId );
529536
0 commit comments