Hi,
I am trying to access the web map (Shared to the organisation) published in the enterprise portal using the ArcGIS API for javascript.
We have used SAML to access the portal (below settings)
Code I am using
Getting the below login screen - tried with my organisation login credentials, it says incorrect username and password? I was expecting to see my portal login screen instead of this? Any help will be appreciated.
When I have to add in a service that requires signing in with my organization creditentials, I have to use OAuthInfo as well as IdentityManager, like this
require([...,
"esri/identity/OAuthInfo",
"esri/identity/IdentityManager",
...
], function (..., OAuthInfo, identityManager, ...) {
const portalUrl = 'your portal url';
const info = new OAuthInfo({
appId: "xxxxxxxxxxxxxxxx", //*** Your Client ID value goes here ***//
popup: false // inline redirects don't require any additional app configuration
});
identityManager.registerOAuthInfos([info]);
// send users to arcgis.com to login
identityManager.getCredential(portalUrl);
identityManager.checkSignInStatus(portalUrl).then(function () {
layer = new FeatureLayer({
portalItem: {
id: "your item"
},
outFields: ["*"]
});
.
.
.
});
To add on to KenBuja answer we have found that when we publish things, portal will automatically assign tokens. Check if any of layers, mapping application, etc. used in the map are using tokens in the data source. I cannot find my notes on it, if I remember correctly we took out the token portion of the url, or changed the token portion of the URL to manager.