Arcgis-js-api Identity Manager with Angular missing uri

801
2
07-09-2018 08:57 AM
PaulGiard
New Contributor III

I am following the repo here https://github.com/andygup/angular-cli-esri-map and trying to use the Identity Manager from ArcGIS-js-api.  Am I missing something?  From the samples this should work.
I receive a not found error with that url, but the server responds when I make a request via Postman
HTTP404: NOT FOUND - The server has not found anything matching the requested URI (Uniform Resource Identifier). GET - https://js.arcgis.com/4.7/esri/IdentityManager.js
ngOnInit() {
loadModules([
'esri/arcgis/OAuthInfo',
'esri/IdentityManager'
])
.then(([OAuthInfo, IdentityManager]) => {


const identityManager = new IdentityManager();

const oAuthInfo = identityManager.findOAuthInfo(portalUrl);

console.log('This is the Oauth Info: ' + oAuthInfo.toJson);
0 Kudos
2 Replies
ReneRubalcava
Frequent Contributor

In 4.x, IdentityManager is located at "esri/identity/IdentityManager".

IdentityManager | API Reference | ArcGIS API for JavaScript 4.8 

That should do it!

0 Kudos
PaulGiard
New Contributor III

It seems to have found the objects but I have a new error:

RROR Error: Uncaught (in promise): TypeError: Object doesn't support this action TypeError: Object doesn't support this action at Anonymous function (http://localhost:4200/main.js:642:13) at ZoneDelegate.prototype.invoke (http://localhost:4200/polyfills.js:2708:13) at onInvoke (http://localhost:4200/vendor.js:50015:17) at ZoneDelegate.prototype.invoke (http://localhost:4200/polyfills.js:2708:13) at Zone.prototype.run (http://localhost:4200/polyfills.js:2460:17) at Anonymous function (http://localhost:4200/polyfills.js:3194:17) at ZoneDelegate.prototype.invokeTask (http://localhost:4200/polyfills.js:2741:13) at onInvokeTask (http://localhost:4200/vendor.js:50006:17) at ZoneDelegate.prototype.invokeTask (http://localhost:4200/polyfills.js:2741:13) at Zone.prototype.runTask (http://localhost:4200/polyfills.js:2510:21)

0 Kudos