AnsweredAssumed Answered

Authentication token is not being appended to urls

Question asked by jon.morris on Aug 20, 2015
Latest reply on Nov 16, 2015 by murdoch

I'm using javascript api to access some secure map and GP services, but am having a lot of problems with tokens.

 

Using IdentityManager to generate tokens is working fine, and I can store them off in a cookie or local storage (as in this sample). However, when I try and load a map service, the console shows Error: Token Required and I get a credential popup over the map.

 

I'm trying to avoid this and have a single sign-on to the site (the user has already signed in on a previous page, so should be able to load services without entering more credentials).

 

Authenticating a second time in the browser might be ok, but I'm then running some GP services and calls to getResultData fail with the same error.

 

In both cases, the call stack leads deep into init.js, so attempting to append a token onto the request is not going to work. What am I doing wrong here? If I've authenticated with IdentityManager, shouldn't all subsequent calls have a token attached?

Outcomes