Connecting Enterprise Portal webmap with JS Api 4x

12-23-2019 02:58 AM
New Contributor


When i try to load a webamp from Enterprise Portal with JS Api 4x, I get a error which says "Invalid clien_id". I defined in my code to the portal url, but the Api tries to connect to ArcGIS Online. The application is not in AGOL, so that makes sense for the error message. What I don't understand is why does it try to connect with ArcGIS Online while I defined the portal url in code which refers to enterprise portal?

The url for the Enterprise Poral is for example:

Here is a snipper of the code:

var portal = new Portal({
var info = new OAuthInfo({
appId: "",
popup: false
var webmap = new WebMap({
portalItem: {
id: ""

Could someone explain what I am doing wrong?

0 Kudos
1 Reply
Esri Regular Contributor

I think what you are looking for is the esriConfig.portalUrl property:

config | ArcGIS API for JavaScript 4.14