Hello everyone,
I would like to generate an access token with the ArcGIS REST API to access private content in ArcGIS Enterprise 10.8.1 either using the oauth2/token or generateToken endpoint. For both cases I managed to generate a token, but when I try to use them to access private services from the Portal I receive everytime an error with the code 498 and the message: Invalid Token.
Below I generate a token using oauth2 application credentials:

After that I try to use the token to get the information from the ArcGIS REST Services Directory main page from a service that is shared privately, as a json response and get the error 'Invalid Token':

Can someone help please or did someone had this issue before? I used the same request to access private content from ArcGIS Online and it worked.