Generate a token to query features from a federated arcgis server

1094
1
Jump to solution
02-21-2022 07:17 AM
roemhildtg
Occasional Contributor III

As the name suggests, I have a ArcGIS Server federated to ArcGIS Portal. Portal auth takes over here so I can generate a token with ArcGIS Portal `/sharing/rest/generateToken`. I can then take this token and generate a server URL token - or so the docs would lead me to believe.

https://developers.arcgis.com/rest/users-groups-and-items/generate-token.htm

but when I get the "server token" the response from the `/query` endpoint is always invalid token. I'm using `client=requestip` and `serverUrl=https://...../server/` and `token=<the portal token i got in step 1>`

Has anyone gotten this working?

 

More details:

 

step 1 - get a portal token:

GreggRoemhildt_0-1645470815663.png

 

 

Step 2 - pass portal token to get a serverToken:

 

GreggRoemhildt_1-1645470837765.png

 

 

Step 3: pass server token to the query endpoint

GreggRoemhildt_2-1645470857184.png

 

0 Kudos
1 Solution

Accepted Solutions
roemhildtg
Occasional Contributor III

Update - I found the issue. Using client:requestip didn't work. No reason as to why - but after changing the client to referer and setting `referer=some-referer` I was able to use the token.

 

GreggRoemhildt_0-1645477791852.png

 

 

 

View solution in original post

1 Reply
roemhildtg
Occasional Contributor III

Update - I found the issue. Using client:requestip didn't work. No reason as to why - but after changing the client to referer and setting `referer=some-referer` I was able to use the token.

 

GreggRoemhildt_0-1645477791852.png