Closed abhishekhingu closed 4 years ago
@abhishekhingu did you run into some errors? I'm assuming you are referring to ArcGIS hosted secure services?
Here's some documentation on working with secured services and the ArcGIS API for JavaScript https://developers.arcgis.com/javascript/latest/guide/secure-resources/
One way to do this is use esri-loader to load the ArcGIS API modules for working w/ identity (like esri/identity/IdentityManager
and esri/identity/OAuthInfo
) as described in the link that @andygup shared above. You would then use those modules to register a token w/ the ArcGIS API before loading the secure layers. This works fine if you only need to work w/ the secure layers when you are going to show the map.
Alternatively if you want users to be able to log in or work w/ the secure layers even when you are not showing a map (i.e. show layer data in a table, etc), you can use arcgis-rest-js to generate the token and/or query the layer data. Then when you are ready to show a map, you can register the token you generated w/ arcgis-rest-js with the ArcGIS API as shown in this demo.
Very interesting answer @tomwayson, thanks !
I have also another use case to access secured resources from an ArcGIS Enterprise secured with SAML and I was not able to find any solution so far: I have an application secured with the very same SAML identify provider and I would like to automatically authenticate the user on this ArcGIS Enterprise without the prompting oauth window so that the map get diplayed without any additional authenticating steps.
Any idea/library/sample you would recommend ?
Many thanks
I'm not personally familiar w/ any such sample, but that's not saying much, I've rarely had to work w/ a SAML provider.
closing due to inactivity