1111use SimpleSAML \Module \oidc \Entities \ClientEntity ;
1212use SimpleSAML \Module \oidc \Entities \Interfaces \ClientEntityInterface ;
1313use SimpleSAML \Module \oidc \Helpers ;
14+ use SimpleSAML \Module \oidc \ModuleConfig ;
1415use SimpleSAML \Module \oidc \Server \Exceptions \OidcServerException ;
15- use SimpleSAML \Module \oidc \Utils \ClaimTranslatorExtractor ;
1616use SimpleSAML \Module \oidc \Utils \RequestParamsResolver ;
1717use SimpleSAML \OpenID \Codebooks \ApplicationTypesEnum ;
1818use SimpleSAML \OpenID \Codebooks \ClaimsEnum ;
@@ -27,7 +27,7 @@ class ClientEntityFactory
2727 public function __construct (
2828 private readonly SspBridge $ sspBridge ,
2929 private readonly Helpers $ helpers ,
30- private readonly ClaimTranslatorExtractor $ claimTranslatorExtractor ,
30+ private readonly ModuleConfig $ moduleConfig ,
3131 private readonly RequestParamsResolver $ requestParamsResolver ,
3232 ) {
3333 }
@@ -130,7 +130,7 @@ public function fromRegistrationData(
130130 // Filter to only allowed scopes
131131 $ scopes = array_filter (
132132 $ scopes ,
133- fn (string $ scope ): bool => $ this ->claimTranslatorExtractor -> hasClaimSet ( $ scope ),
133+ fn (string $ scope ): bool => array_key_exists ( $ scope , $ this ->moduleConfig -> getScopes () ),
134134 );
135135 // Let's ensure there is at least 'openid' scope present.
136136 $ scopes = empty ($ scopes ) ? [ScopesEnum::OpenId->value ] : $ scopes ;
0 commit comments