The web map is shared only with a group and a technical user has the access to this group.
Whoever access the coordys application should be able to view the GIS map without asking authentication. The technical user is configured in Coordys to generate the token directly from portal and pas the token details to GIS map viewer with a service.
We are able to get the token before creating the map and utilized in Identity manager to register. However, while creating the map the error returned in JS and map is not creating.
require([
"esri/map",
"esri/toolbars/navigation",
"esri/layers/FeatureLayer",
"esri/dijit/PopupTemplate",
"esri/InfoTemplate",
"esri/geometry/webMercatorUtils",
"esri/layers/FeatureLayer",
"esri/layers/LayerInfo",
"esri/urlUtils",
"esri/arcgis/utils",
"esri/layers/Field",
"esri/config",
"esri/tasks/GeometryService",
"esri/dijit/OverviewMap",
"esri/dijit/Legend",
"esri/dijit/LayerList",
"esri/dijit/Scalebar",
"esri/dijit/HomeButton",
"esri/dijit/Search",
"esri/dijit/BasemapGallery",
"esri/dijit/Basemap",
"esri/dijit/Measurement",
"esri/dijit/LocateButton",
"esri/geometry/Point",
"esri/SpatialReference",
"esri/IdentityManager"
],
function (Map, Navigation, FeatureLayer, PopupTemplate, InfoTemplate, webMercatorUtils, FeatureLayer, LayerInfo, urlUtils, arcgisUtils, Field, esriConfig, GeometryService, OverviewMap, Legend, LayerList, Scalebar, HomeButton, Search, BasemapGallery, Basemap, Measurement, LocateButton, Point, SpatialReference, esriId
) {
parser.parse();
var tokenProp = { expires: parseInt(globalPSObj.expires), server: Configs.portalurl + "/sharing/rest", ssl: globalPSObj.ssl, token: globalPSObj.Token, userId: globalPSObj.userId };
esriId. registerToken(tokenProp);
arcgisUtils.arcgisUrl = Configs.portalurl + "/sharing/content/items";
arcgisUtils.createMap(Configs.webmapid, "map").then(function (response) {
var map = response.map;
var ProjectRequests, Estimates, ProposedProjects, PR_Point;
}
});
Please advice the approach I am following is correct or what is the best way to implement this to by pass the user login.