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.
{
"error": {
"code": 498,
"message": "Token Invalid.",
"details": [
"The required authentication information is invalid. The token is either invalid or has expired."
],
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.
I am following this link for API key generation "https://developers.arcgis.com/documentation/security-and-authentication/api-key-authentication/tutor...
and to test my API key, I am using this simple base map "https://developers.arcgis.com/javascript/latest/tutorials/change-the-basemap-style/"
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.
@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.
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.