Select to view content in your preferred language

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

2000
15
Jump to solution
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
1 Solution

Accepted Solutions
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

View solution in original post

15 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
DeanWilson
Regular Contributor

Hi @LaurenBoyd and @John-Foster ,

I've been having similar issues to @FarrukhZahid as far as using API keys.  The documentation you linked was the first time I seen that note, because all of the docs I've been going through kept mentioning that you get api key auth if you're using enterprise server 11.4.  Since the Maps SDK, at least per that obscure note that I wouldn't have looked for in the Arcgis Portal section of the Maps sdk, doesn't allow auth via api keys yet, does that include Experience Builder as well? 

I was hoping this was the fix for my portal sharing problem where I have secure services built in the portal, and when I try to access popups publicly, it asks for a login. 

Sorry if that sounds curt,  I've been going rounds with these auth issues for awhile. 

 

Thanks in advance!

0 Kudos
LaurenBoyd
Esri Contributor

Hi @DeanWilson & @FarrukhZahid -

Good news! Using API keys to access ArcGIS Enterprise secure services with the JS Maps SDK is supported at version 4.33. You can set the API key directly on the layer class or set a globally configured API key. Check out the API key authentication documentation and the release notes for more details.

Hope this helps!

Lauren
DeanWilson
Regular Contributor

Hi @LaurenBoyd 

I did indeed get API keys working with a testing web application using some of the web components which was nice.  One thing I wouldn't mind seeing in the documentation is how to use said API keys using an application built via Experience Builder Developer edition.  We use a local enterprise portal and not AGO.  Can you or anyone direct me to said documentation?  

 

Thanks in advance!

 

Dean

0 Kudos
John-Foster
Esri Contributor

Experience Builder does not yet support API key authentication. Please put a comment in their Ideas channel to request this feature - https://community.esri.com/t5/arcgis-experience-builder-ideas/idb-p/arcgis-experience-builder-ideas

--jf
0 Kudos
TimWestern
MVP

@John Google search might be confusing people on this matter, I tried a search:

arcgis experience builder API Key authentication and it's AI spit out this:

TimWestern_0-1752496116285.pngTimWestern_1-1752496125140.png

 


one of the links went here: https://developers.arcgis.com/documentation/security-and-authentication/types-of-authentication/#:~:.... But it does not mention EXB just AGOL and AGE, and a bunch of program language APIs.  There is nothing in that documentation to alert folks that Experience Builder does not currently have this capability, but multiple other products do, unfortunately, that doesn't help those who need that feature


@DeanWilson Unfortunately, I believe John-Foster is correct that EXB does not currently support API Keys.  It can be suggested at: https://community.esri.com/t5/arcgis-experience-builder-ideas/idb-p/arcgis-experience-builder-ideas 

0 Kudos
DeanWilson
Regular Contributor

@John-Foster and @TimWestern ,

Thanks for the information on this.  I've been trying my best to utilize the new tooling that we're being given by ESRI but it's not working out.  We may be sticking with Web Appbuilder for awhile longer I think.

0 Kudos