Permission requirements for REST API calls to generateToken

840
5
Jump to solution
01-24-2023 09:07 AM
WarrenMedernach
Occasional Contributor III

I'm struggling with getting a non Portal site admin user account to be able to generate a token?

Using Postman if I generate a POST call with the username and password of the Portal Site Admin in the body to: https://<URL>/arcgis/tokens/generateToken I get a valid token back:

WarrenMedernach_0-1674579977487.png

If I do this exact same call with a different user it reports back:

You are not authorized to access this information
WarrenMedernach_1-1674580003046.png

 

 Are there specific access requirements to be able to acquire a token?
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
shahkunal
New Contributor II

Hello @WarrenMedernach ,

I think you need to use generateToken REST URL of your organization portal which will be https://<domain>/portal/sharing/rest/generateToken. Before that you need to create user in your organization with specific role and then hit above URL with the credentials

View solution in original post

0 Kudos
5 Replies
shahkunal
New Contributor II

Hello @WarrenMedernach ,

I think you need to use generateToken REST URL of your organization portal which will be https://<domain>/portal/sharing/rest/generateToken. Before that you need to create user in your organization with specific role and then hit above URL with the credentials

0 Kudos
Gordon_Aberdeen
New Contributor III

Did you ever solve this Warren?

0 Kudos
WarrenMedernach
Occasional Contributor III

Hi Gordon,

Unfortunately no, I never did get past having to use an 'admin' level user to return a token.

0 Kudos
Trevor_Hart
Occasional Contributor

@WarrenMedernach I believe @shahkunal was correct. You appear to be requesting a token from the ArcGIS Server end point. If your ArcGIS Server is federated you will need to generate a token from the Portal end point. This will be valid for the ArcGIS Server once generated.

Remember, a federated ArcGIS Server doesnt know anything about any users except the admin user it was configured with - hence the error.

WarrenMedernach
Occasional Contributor III

Thanks for the confirmation/reminder Trevor.  I have confirmed that a non-admin can indeed authenticate through the Portal generatetoken call.

0 Kudos