1 | <?php |
||
20 | final class DistributedClaimSource implements ClaimSourceInterface |
||
21 | { |
||
22 | /** |
||
23 | * {@inheritdoc} |
||
24 | */ |
||
25 | public function getUserInfo(UserAccountInterface $userAccount, array $scope, array $claims) |
||
26 | { |
||
27 | if ('user2' === $userAccount->getPublicId()->getValue()) { |
||
28 | $claims = ['address', 'email', 'email_verified']; |
||
29 | $source = [ |
||
30 | 'endpoint' => 'https://external.service.local/user/info', |
||
31 | 'access_token' => '0123456789', |
||
32 | 'token_type' => 'Bearer', |
||
33 | ]; |
||
34 | |||
35 | return new Source($claims, $source); |
||
36 | } |
||
37 | } |
||
38 | } |
||
39 |