How to get permissions in a javascript mapper?

I am using RPT tokens and want to read out the permissions from the token.

I am trying:
var auth = Java.type(“org.keycloak.representations.AccessToken.Authorization”);
auth = token.getAuthorization();
auth.getPermissions();

But “token.getAuthorization()” returns null

Any idea how to proceed?