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?