Inject Role attributes to an access token

Hi
Is there a way to add to the access token a group/role attributes?

I have a realm with a role named “Supervisor” with some attributes (for exmpale {role:supervisor} and {permissions:machines.create})
now I have a user that is associated with this role (as a realm role)
when I log in with this user’s credentials using the Rest API I get an access token but without the attributes from the role

I read in some posts in SOF that are saying that it is not possible and you need some sort of script mapper but it’s in java and we are using the Rest API and not a java app.

is there any hope to achieve this using a configuration in the admin console?

thanks

edit:
those are the post from SOF:
https://stackoverflow.com/questions/62704593/map-a-role-attribute-to-a-jwt-token-in-keycloak

https://stackoverflow.com/questions/55702315/accessing-keycloak-roles-users-attributes-from-java-api/56485720#56485720