Hi All,
I am using custom base map into my application , but the application is prompting to enter the credentials. I want avoid the login window and pass the credentials in the code itself. Kindly suggest me the idea.
var baseMapLayer = new TileLayer({
url: <basemap URL>
});
const customBasemap = new Basemap({
baseLayers: [baseMapLayer]
});
map = new Map({
basemap: customBasemap
});
Best Regards,
K.Jayakumar
Hi K,
I would suggest using a token in your code, you could use a proxy to call the generateToken rest endpoint on a portal.
https://developers.arcgis.com/rest/users-groups-and-items/generate-token.htm
You can then use this with the IdentityManager class (https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html)
Regards,
Jethro