Select to view content in your preferred language

{error: {code: 498, message: "Token Invalid.", ...}

398
5
03-11-2025 05:30 AM
FarrukhZahid
Emerging Contributor

HI, 

I am currently using ArcGIS Enterprise 11.4 (Portal-Federated Server) with a developer account subscription. When generating a simple basic API key, I repeatedly encounter a white screen. Checking the network reveals error 498. I have attempted this in different environments, yet the issue persists. Although my environment is secured, I am facing this problem on my local machine (Secured Environment) where the portal is installed. Each time, the key appears as an invalid token.

FarrukhZahid_0-1741696041480.png

{
"error": {
"code": 498,
"message": "Token Invalid.",
"details": [
"The required authentication information is invalid. The token is either invalid or has expired."
],

0 Kudos
5 Replies
JoshuaBixby
MVP Esteemed Contributor

If the software is consistently telling you the token is invalid, there is likely something wrong with either the credentials or how the token is being generated.  Unless you provide more information about how you setup the "simple basic API key" and how exactly you are using the key to generate a token, there isn't much for anyone to comment on here.

0 Kudos
FarrukhZahid
Emerging Contributor
0 Kudos
LaurenBoyd
Esri Contributor

Hi @FarrukhZahid -

The JavaScript Maps SDK currently only supports using API keys with ArcGIS Online and ArcGIS Location Platform users as outlined here: https://developers.arcgis.com/javascript/latest/secure-resources/#api-keys 

API keys generated with an ArcGIS Enterprise user is planned to be supported at the next release (version 4.33). In the meantime, you could utilize RequestInterceptor to append the API key generated with your Enterprise account as the token parameter to all requests before the request is sent to the basemap service.

Lauren
John-Foster
Esri Contributor

@FarrukhZahidan api key generated on ArcGIS Enterprise can only authorize services on that Enterprise instance, so if you are using a key generated on ArcGIS Enterprise to authorize services on ArcGIS Online then you will expect to see error 498 Invalid Token. You will need to log in with an ArcGIS Online account and generate and API key there in order to authorize services from ArcGIS Online.

--jf
TimWestern
MVP

I'm curious, You mentioned a Portal Federated Server (For these dashboards are users logging in through that federation? If so I'm wondering why an APIKey vs an OAuth2 key is preferred here for your purposes.

0 Kudos