Select to view content in your preferred language

Javascript Error Message in Console

4926
10
Jump to solution
05-08-2015 10:44 AM
ChrisHolmes
Occasional Contributor III

Hello everyone,

I am getting the following error message in the Chrome console. It happens after I click the pin to try to add a point to the map. I know that some things have changed in our environment here which I think is not allowing me to edit and I`m going to ask about that separately. But I jus thought that I would also post up the error message here along with the html/css file being used to see if anyone has some insight that they could share.

Thanks everyone!

Tags (1)
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Chris,

   Do you not see in the proxy documentation where you can provide a user name and password for the server entry. You would not be using un-named users your proxy would have a valid named user in the proxy.config that would allow your app to log into your secured service (does not matter who the actual end-user on the client is).

View solution in original post

0 Kudos
10 Replies
RobertScheitlin__GISP
MVP Emeritus

Chris,

   Is your proxy providing the token for your feature service access?

ChrisHolmes
Occasional Contributor III

Hi Robert, I have not set this up. I will search out the help file about setting up proxy and see where I can get to.

Thank you

0 Kudos
ChrisHolmes
Occasional Contributor III

So I`ve been spending time this afternoon setting up and testing the proxy on my localhost and it is now working. I found the following articles helpful:

http://blogs.esri.com/esri/supportcenter/2015/04/07/setting-up-a-proxy/

https://developers.arcgis.com/authentication/accessing-arcgis-online-services/

https://developers.arcgis.com/javascript/jshelp/ags_secureservices.html

Now onto figuring out this token stuff. Does it make sense that currently when the application loads it prompts me for a username/password which I enter (and it seems to like) and it continues to load the application. But then it breaks when I try to do something after it's loaded it doesn't work as it no longer knows who I am??

RobertScheitlin__GISP
MVP Emeritus

Chris,

   As the feature service you are using is secured and requires a token this is why you are prompted with the identity manager to provide your credentials. A proxy would allow you to provide those credentials in the proxy (serverside) and not prompt the end user. I am not sure what your desired apps workflow is but being that the feature service requires a token, that is the first thing I saw in your apps code and that you set the proxy path so I thought that you already had this in place. If you want the end user to continue to get challenged by the identity manager then you don't have to worry about configuring the proxy to supply the credentials.

ChrisHolmes
Occasional Contributor III

So, if I wasn't concerned about the whole using the proxy to manage username/password thing, wouldn't the Identity Manager prompt me for username/password everytime it tries to do something with the feature service? So far it only prompts me once for username/password when the application loads, then it just errors out when I try to do something else requiring the feature service. Thanks!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Chris,

   No, not at all one of the main things that the identity manager does is maintain the credentials and make a token request behind the scenes if the token has expired during the lifetime of the app that initiated it. So bottom line, No you would not expect to be prompted again.

ChrisHolmes
Occasional Contributor III

Ok, thanks Robert.

ChrisHolmes
Occasional Contributor III

So, I've finally gotten back to working on this and by looking at the IdentityManager samples I have it to where I log in once initially and the app does not error out when I subsequently try to use the feature service. Granted while this is not what I'm after it's at least shown me that it works (I think ).

My ultimate goal with this application is to allow anyone to use the application and to add new point data (including attribute data) without the need to log in (these users won't even have AGOL accounts anyway). What I'm stumbling with right now is what do I need to add to the proxy.config file and to my index.html file (for now I'm just doing all code in the index file) to make this happen. I've found samples telling me what to do with proxy.config related to routing and the traffic service but I have not found examples that show me what to add to proxy.config and index.html to handle the login for unnamed users.

Thanks everyone!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Chris,

   Do you not see in the proxy documentation where you can provide a user name and password for the server entry. You would not be using un-named users your proxy would have a valid named user in the proxy.config that would allow your app to log into your secured service (does not matter who the actual end-user on the client is).

0 Kudos