Token generation Error

360
2
06-30-2021 05:16 AM
MANESK
by
New Contributor III

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.

0 Kudos
2 Replies
DavidPike
MVP Frequent Contributor

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?

0 Kudos
ChristopherPawlyszyn
Esri Contributor

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