I'm trying to access sentinel 2 and landsat through Esri JS version 3.39 at the following urls:
https://landsat2.arcgis.com/arcgis/rest/services/Landsat8_Views/ImageServer
According to the documentation, you can access the services in the following manner.
I have created an api key through the developer dashboard and tried to set the apiKey in esriConfig.
esri.config.apiKey = "myApiKeyHere";
I have also attempted to pass it in the url with url?token=myApiKeyHEre
When I try to call ImageServiceIdentifyTask, I get the following response
{"error":{"code":499,"message":"Token Required","details":[]}}
I have also attempted to use the generateToken link here
https://landsat2.arcgis.com/arcgis/tokens/generateToken
Upon entering my credentials, I get the following message:
You are not authorized to access this information
What is the correct method to authenticate with these services using Esri JS version 3.39?