AnsweredAssumed Answered

Bypass Identity Manager with ArcGIS.com OAuth token object

Question asked by kramer_usc on Aug 6, 2013
Latest reply on Feb 2, 2017 by sgourley
Hi All,
I know this is similar to a recent post, but I think its different enough to merit its own thread.  I want to access one of my feature layers (using REST Url) from my organization's ArcGIS.com using the OAuth token generated using the methodology show here: https://developers.arcgis.com/en/authentication/app-logins.html.  That works great, and I got the JSON token. However now, I am unsure how to pass that JSON token in my JS app to prevent the Identify Manager login from appearing.  Initially I thought that I could pass it in the FeatureLayer's credential property, but that looks like it only returns when the feature layer is loaded.  I looked at one sample that stores the Identity Manager on the local system, but the "kernel.id.initialize(token)" statement does not seem to work either.  I do see that IdentityManagerBase has a registerToken function, but I can't seem to figure out how to implement that.

Can somebody please provide me with a code snippet on how this is done?

Thanks!

Ian

Outcomes