Triying to migrate firebase from Legacy FCM API to HTTP v1 getting "Insufficient Permission" – Stack Overflow

I am following this tutorial: medium.com/@vc21496/migrating-from-legacy-fcm-apis-to-http-v1-api-in-php-63076c5aa212

Using ‘google-auth-library’ in typescript:

    const {JWT} = require('google-auth-library');

    var keys_lit  =  fs.readFileSync('./resources/firebase/service.json', {encoding:'utf8', flag:'r'});
    var keys = JSON.parse(keys_lit);

    const client = new JWT({
        email: keys.client_email,
        key: keys.private_key,
        scopes: ['https://www.googleapis.com/auth/firebase.messaging']
    });
    const url = `https://dns.googleapis.com/dns/v1/projects/${keys.project_id}`;
    const res = await client.request({url});
    console.log(res.data);

I got:

enter image description here

I saw the permissions and roles and i think that the account used in the json has the rigth to create tokens:

enter image description here

Read more here: Source link