Monday, July 4, 2016

ArcGIS WebAppBuilder: No Token Found Problem

(Solved) ArcGIS WebAppBuilder "No Token Found" Problem.
Recently, I tried ArcGIS WebAppBuilder. I found this interesting because it let you layout web map application without coding required. Moreover, setting up is very easy. I only download the zip file and just double click batch files to start the app. When I want to move WebAppBuilder to new computer, I just rezip files and move to new computer. That's it!

However, after I ran the WebAppBuilder on new computer, I got this error:

[INFO] server - No token is found, redirect /webappbuilder to /webappbuilder?action=setportalurl

I tried to research for the related problem on website. But wihtout luck. So, I decided to start finding solution on my own.

At first, I found that the error occurred in file /server/server.js which check if info variable is valid or not, and info variable is define in line 278 like this

var info = signinInfoRest.getSignInInfoByPortalUrlApi(req.cookies.wab_portalurl_persistent);

This means that server was trying to find the cookies. But new computer does not have it. So, I came back to old computer and copy every cookies that related to the WebAppBuilder.

To get cookies from firefox browser. I use CookieManager+ Addon:


I copied 3 cookies as follows
  • wab_auth
  • wab_portalurl
  • wab_portalurl_persistent
I saved cookies and went to new computer. But before I set cookies, some cookie value is URL encoded like this

%7B%22referer%22%3A%22localhost%3A3344%22%2C%22server%22%3A%22https%3A%2F%2

I have to decoded it first. You can use Notepad++ to decode URL, or use online website as you want.

After setting cookies successful. Refresh your WebAppBuilder and it will come alive again.



Happy Coding!

No comments:

Post a Comment