AnsweredAssumed Answered

Problems with using token and javascript API

Question asked by _lars_ on Sep 1, 2017
Latest reply on Sep 1, 2017 by _lars_

Hello!

 

I'm implementing featurelayers from a companies arcgis server and until now I've been polled for username and password in the website I'm making. Its a webresource inside Dynamics so authentication is already handled. I see the arcgis server has the feature to create tokens at .../arcgis/tokens and I created one for my application.

 

I'm unsure of what client, as I have not declared it somewhere. I've tried;

- HTTP Referer with the address of the dynamics installation (something.crm3.dynamics.com)

- IP (ip of something.crm3.dynamics.com)

- Request IP (but that would not work as I'm doing the request from my work laptop)

 

I've implemented the token as stated in the documentation:

 

var layer = new FeatureLayer({
url: "https://foo.boo.no/arcgis/rest/services/appname1/appname2/MapServer/0",
token: "<token>"
});

map.add(layer);

 

The <token> is the one generated from .../arcgis/tokens.

 

I tried all the types of clients as tokens in the FeatureLayer request but nothing changes, I am still prompted to insert username and password.

 

Does anyone have and idea? I need to replace the popup of username and password with the token in the background.

Outcomes