public function finalizeScopes(
        array $scopes,
        $grantType,
        ClientEntityInterface $clientEntity,
        $userIdentifier = null
    ) {
        $app = Facade::getFacadeApplication();
        $allowedScopes = $app->make('config')->get('app.api.scopes');
        $winnowed = [];
        foreach ($scopes as $scope) {
            if (in_array($scope->getIdentifier(), $allowedScopes)) {
                $winnowed[] = $scope;
            }
        }

        return $winnowed;
    }