|
28 | 28 | use SimpleSAML\Module\oidc\Entities\Interfaces\AuthCodeEntityInterface; |
29 | 29 | use SimpleSAML\Module\oidc\Entities\Interfaces\RefreshTokenEntityInterface; |
30 | 30 | use SimpleSAML\Module\oidc\Entities\UserEntity; |
| 31 | +use SimpleSAML\Module\oidc\Entities\ScopeEntity; |
31 | 32 | use SimpleSAML\Module\oidc\Factories\Entities\AccessTokenEntityFactory; |
32 | 33 | use SimpleSAML\Module\oidc\Factories\Entities\AuthCodeEntityFactory; |
33 | 34 | use SimpleSAML\Module\oidc\Helpers; |
@@ -903,6 +904,23 @@ public function validateAuthorizationRequestWithRequestRules( |
903 | 904 | ); |
904 | 905 | $authorizationRequest->setAuthorizationDetails($authorizationDetails); |
905 | 906 |
|
| 907 | + // TODO This is a band-aid fix for having credential claims in the userinfo endpoint when |
| 908 | + // only VCI authorizationDetails are supplied. This requires configuring a matching OIDC scope |
| 909 | + // that has all the credential type claims as well. |
| 910 | + foreach ($authorizationDetails as $authorizationDetail) { |
| 911 | + if ( |
| 912 | + (isset($authorizationDetail['type'])) && |
| 913 | + ($authorizationDetail['type']) === 'openid_credential' |
| 914 | + ) { |
| 915 | + $credentialConfigurationId = $authorizationDetail['credential_configuration_id'] ?? null; |
| 916 | + if ($credentialConfigurationId !== null) { |
| 917 | + array_push($scopes, new ScopeEntity($credentialConfigurationId)); |
| 918 | + } |
| 919 | + } |
| 920 | + } |
| 921 | + $this->loggerService->debug('authorizationDetails Resolved Scopes: ', ['scopes' => $scopes]); |
| 922 | + $authorizationRequest->setScopes($scopes); |
| 923 | + |
906 | 924 | // Check if we are using a generic client for this request. This can happen for non-registered clients |
907 | 925 | // in VCI flows. This can be removed once the VCI clients (wallets) are properly registered using DCR. |
908 | 926 | if ($client->isGeneric()) { |
|
0 commit comments