Select to view content in your preferred language

Generate access token with ArcGIS REST API in ArcGIS Enterprise 10.8.1

1555
1
03-15-2022 04:12 AM
andrei_ste
Occasional Contributor

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:

token_oauth2.jpg

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':

token_oauth2_1.jpg

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.

0 Kudos
1 Reply
andrei_ste
Occasional Contributor

So I managed to create a valid token using the generateToken endpoint:

form-urlencoded.jpg

I was using client=ip or client=requestip instead of client=referer and this was generating a token that wasn't valid. Still having problems generating a token with oauth2, app login. Can someone please provide an example?

0 Kudos