Hi all,
I'm having a hard time figuring out how to achieve a Single Sign On experience from a JS application. Let me explain in detail my situation:
What I got until now is the ESRI authentication dialog appearing as soon as I load the tile layer.
What I want is to access the Tile Layer using the token that I obtained from the IdentityServer, without the user having to sign in again.
Here is the JS code I use to display the map and the Tile Layer:
var map = new Map({
layers: [new TileLayer({url: basemapUrl})]});
var view = new MapView({
container: "viewDiv",
map: map
});
esriConfig.portalUrl = 'http://atlhqmvmsdev4.eusc.europa.eu/arcgis';
var portal = new Portal({ isPortal: true });
portal.authMode = "auto";
portal.load().then(function () {
Layer.fromPortalItem({
portalItem: {
id: "1b4c51aa3feb42bba71ae02195e03f75" // ID of the Tile Layer item
}
})
.then(function (layer) {
map.add(layer);
})
});
mgr.getUser().then(function (user) {
esriId.registerToken({
token: user.access_token,
server: portalUrl
});
});
What am I missing? Any hint or clarification is very welcome!
Hi,
Did you get this issue fixed ? I am having the same problem with ESRI Federated Server.
Thanks,
Astha