I'm trying to generate token for accessing a secured service in an JavaScript application. We are using Federated Server 10.8. while trying to generate a token using a URL in the browser , the attached error appears. Kindly Suggest.
Do you have to retrieve the token via a GET? Enable token acquisition through an HTTP GET request—ArcGIS Server | Documentation for ArcGIS Enterprise
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 Developershttps://developers.arcgis.com/rest/users-groups-and-items/generate-token.htm
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.