Do you have to retrieve the token via a GET? Enable token acquisition through an HTTP GET request—ArcGIS Server | Documentation for ArcGIS Enterp...
or can you do a POST via the REST instead?
For a federated ArcGIS Server site, you should first generate a token for the associated Portal for ArcGIS user, then use that generated token to create a server token from the same endpoint (see reference below). I think @DavidPike is correct that you're trying to generate a token from Server using a GET request judging by the error, but taking into account the federation aspect means you shouldn't be using a token generated from the ArcGIS Server endpoint at all.
/generateToken: Generate Token—ArcGIS REST API | ArcGIS Developers
https://developers.arcgis.com/rest/users-groups-and-items/generate-token.htm