I'm using ->isGranted('ROLE_SCOPE1') to authorize a machine token so there is no user context.
Since Symfony 5.4, AuthorizationChecker relies on getUser() instead of getToken() which make user-less access tokens not authenticated (cf diff).
In some way Symfony introduced a BC break but I think the OAuthToken should fill the user property with a string constant to pass this condition.
What do you think?
@nicolas-grekas what would be the good practice?