POST
|
That's the thing, I can get the token and am already passing the token to the service like this: var supportFeatureLayer = new FeatureLayer(OurRESTUrl + "?token=" + GISToken,{ outFields: ["*"] }); I've already found a way to get the token back from our token service URL. The problem is that even when I pass it to the FeatureLayer -- as described above -- I get a login screen. When I look at the developer tools, I see a request being sent to our REST service URL (http://<REST_SERVICE_URL>?f=json&token=mE9rsU4yaSaGSnfgGas2o0… ), and I also see data being sent back like this: {"currentVersion":10.31,"id":6,"name":"TOA.Supports","type":"Feature Layer","description":"","copyrightText":"","defaultVisibility":true,"editFieldsInfo":{"creationDateField":"created_date","creatorField":"created_user","editDateField":"last_edited_date","editorField":"last_edited_user"},"ownershipBasedAccessControlForFeatures":null,"syncCanReturnChanges":true,"relationships":[{"id":1,"name":"TOA.Signs_O","relatedTableId":1,"cardinality":"esriRelCardinalityOneToMany","role":"esriRelRoleOrigin","keyField":"GLOBALID","composite":true},{"id":0,"name":"TOA.Signs_D","relatedTableId":0,"cardinality":"esriRelCardinalityOneToMany","role":"esriRelRoleOrigin","keyField":"GLOBALID","composite":true},{"id":3,"name":"TOA.Signs_P","relatedTableId":2,"cardinality":"esriRelCardinalityOneToMany","role":"esriRelRoleOrigin","keyField":"GLOBALID","composite":true},{"id":4,"name":"TOA.Signs_R","relatedTableId":3,"cardinality":"esriRelCardinalityOneToMany","role":"esriRelRoleOrigin","keyField":"GLOBALID","composite":true},{"id":5,"name":"TOA.Signs_S","relatedTableId":4,"cardinality":"esriRelCardinalityOneToMany","role":"esriRelRoleOrigin","keyField":"GLOBALID","composite":true},{"id":6,"name":"TOA.Signs_W","relatedTableId":5,"cardinality":"esriRelCardinalityOneToMany","role":"esriRelRoleOrigin","keyField":"GLOBALID","composite":true},{"id":7,"name":"Meters","relatedTableId":9,"cardinality":"esriRelCardinalityOneToMany","role":"esriRelRoleOrigin".... So, the service is sending data something back to my application, but I still get a login window. I saw this post --Bypass IdentityManager Popup in ESRI ArcGIS JavaScript API | River on Bridge... -- but I after implementing the JavaScript code, I still get the login window.
... View more
09-09-2016
10:40 AM
|
0
|
0
|
1431
|
POST
|
In my application, I'm trying to add a FeatureLayer to a map. The FeatureLayer url requires a token, which is created when a user name and password are provided. I don't want the user to have to enter the user name and password, so what I've done is create a method that sends the user name and password to our token service, which then returns the token. I then pass the token to the FeatureLayer as follows: var map = new Map({ basemap: "streets", slider: false }); var view = new MapView({ container: "viewDiv", center: [-77.007308, 38.875827], zoom: 18, map: map }); var supportFeatureLayer = new FeatureLayer({ url: config.layers.support + "?token=" + GISToken, token: GISToken, outFields: ["*"] }); map.add(supportFeatureLayer); However, I still get a "Sign In" prompt, despite that I see data being returned by the REST service, using IE's developer tools. I've attached a screenshot. Is this the correct way to pass a token to a REST service? Is there no way to prevent the "Sign In" prompt returned by the service?
... View more
09-09-2016
08:02 AM
|
1
|
4
|
4523
|
Title | Kudos | Posted |
---|---|---|
1 | 09-09-2016 08:02 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|