'username' => 'admin',
'password' => 'shopware',
'scope' =>
[],
];
$client->
request('POST', '/api/oauth/token',
$authPayload);
static::
assertNotFalse($client->
getResponse()->
getContent());
$data = \
json_decode($client->
getResponse()->
getContent(), true, 512, \JSON_THROW_ON_ERROR
);
$parsedAccessToken =
$jwtTokenParser->
parse($data['access_token'
]);
static::
assertInstanceOf(UnencryptedToken::
class,
$parsedAccessToken);
$accessTokenScopes =
$parsedAccessToken->
claims()->
get('scopes'
);
static::
assertEqualsCanonicalizing(['admin', 'write'
],
$accessTokenScopes);
} public function testUniqueAccessTokenScopes(): void
{ $client =
$this->
getBrowser(false
);
$configuration =
$this->
getContainer()->
get('shopware.jwt_config'
);
$jwtTokenParser =
$configuration->
parser();
$authPayload =
[