|
POST
|
followed the example on how to persist identity manager info using local storage or cookie. http://developers.arcgis.com/en/javascript/jssamples/widget_identitymanager_client_side.html I've discovered a problem, occasionally you come back to the JS app using FireFox and you are prompted with identityManager signIn dialog. You enter valid credentials, the modal signIn disappears, then re-appears with an error: "this value is required" for the password field. I was finally able to reproduce the problem, you can perform these steps with the above sample: 1. login to js app normally by supplying valid credentials 2. close the tab or browser; dojo.addOnUnload() stores the current, valid, credential object in localStorage as a string 3. locate the string in localStorage (i used SQLite Manager extension in FF) 4. change a single character in the token, you essentially in-validate the token 5. new tab in FF, try to login to the js app; you will be presented with the password error on the signIn dialog Step 5 above, firebug never shows a call to the token service to obtain a new token. After pressing the OK button on the signIn dialog, all the layers are attempting to be accessed with a URL qString like so: https://servicesbeta.esri.com/ArcGIS/rest/services/SanJuan/TrailConditions/FeatureServer/0?f=json&token=theInvalidTokenYouEdited I assume the token service is not called because the token that was loaded from localStorage is not expired, it's just invalid. any advice on how to force identityManager to acquire a new token when the token in localStorage is invalid? thanks.
... View more
05-02-2013
10:09 AM
|
0
|
6
|
3503
|
|
POST
|
and public accounts can't share private data with other public accounts, when we used to be able to. Unfortunately, this is always how "free" services eventually become. Unless you dev. the solution, you dont' have control over it...even if you purchase several licenses for desktop & server.
... View more
03-29-2013
02:19 PM
|
0
|
0
|
1233
|
|
POST
|
I've been asked why do we need a subscription for ArcGis Online when we have an ArcGis Server with an Enterprise license. What are the advantages of ArcGis Online over an ArcGis Server, if any? I need a business reason to justify the expense of the subscription. A few months back I attended an ArcGis Online demo and I asked why you still needed an ArcGis server if you have an ArcGis Online subscription. And the answer was ArcGis Online didn't yet offer all the features that a server provides. Is there a matrix that details the differences in the features between the two. I work as a sys admin who manages the ArcGis Server. I'm not a Gis Desktop Analyst with an in depth knowledge of the product gained from working with it eight hours a day. Thanks this is a great question. Back in 2012 when we purchased a new server and ArcGIS for Server Workgroup, we would have been much ahead if we would have gone the arcgis online subscription route. Now we're stuck with a $10k setup that has limited functionality and told to purchase more. I guess 1 nice thing about having your own server is you don't have to mess with credits and a limited ammt. of users...or atleast with v 10.11, this is probably coming in 10.2
... View more
03-22-2013
11:30 AM
|
0
|
0
|
1437
|
|
POST
|
Hopefully this helps someone in the future... ended up using the 1st method; checking the referrer. If any referrer exists and the user doesn't have a good existing cred in storage, an esri.request is made to pass referrer to the proxy for handling. If all checks pass, return a token, which then gets stored as cred. here's the js
var cred = "esri_jsapi_id_manager_data";
function init() {
loadCredentials(); //see if cred. already exists for this session
esri.config.defaults.io.proxyUrl = "proxy.php";
esri.config.defaults.io.alwaysUseProxy = false;
var process = function(ref) {
var def = new dojo.Deferred();
if (ref != "" && esri.id.credentials.length == 0) {
var refToken = esri.request({
url : "https://gis.ourdomain/arcgis/", //any url that's proxied in proxy
content : {
ref : ref
},
handleAs : "json"
});
function success(res) {
var idObject, idJson;
if (res.token != 'noToken') {
var serverInfo = {
"server" : "https://gis.ourdomain.com",
"tokenServiceUrl" : "https://gis.ourdomain.com/arcgis/tokens/",
"currentVersion" : 10.11
};
var securedServices = [];
//i guess this doesn't have to be a complete list
securedServices.push("https://gis.ourdomain.com/arcgis/folder/MapServer/0");
var creationTime = (new Date).getTime();
var idString = dojo.toJson({
"serverInfos" : [serverInfo],
"credentials" : [{
"userId" : 'auser', //user that was hard coded
"server" : serverInfo.server,
"token" : res.token,
"expires" : res.expires,
"ssl" : false,
"creationTime" : creationTime,
"resources" : securedServices
}]
});
if (supports_local_storage()) {
// use local storage
window.localStorage.setItem(cred, idString);
idJson = window.localStorage.getItem(cred);
} else {
// use a cookie
dojo.cookie(cred, idString, {
expires : 1
});
idJson = dojo.cookie(cred);
}
if (idJson && idJson != "null" && idJson.length > 4) {
//load the credential
idObject = dojo.fromJson(idJson);
esri.id.initialize(idObject);
}
def.callback("loaded");
}
else {
def.callback("not loaded"); //proxy didn't return token for 1 reason or other
}
}
refToken.then(success);
}
else {
def.callback("not loaded"); //no referrer or already logged in
}
return def;
}
var ref = document.referrer;
process(ref).then(function(response) {
//continue adding layers, ect...
})
}
heres the pertinent parts of the proxy.php
$targetUrl = $_SERVER['QUERY_STRING'];
$parts = preg_split("/\?/", $targetUrl);
$targetPath = $parts[0];
$qStringArr = array();
parse_str($parts[1],$qStringArr);
// open the curl session
$session = curl_init();
if(array_key_exists('ref', $qStringArr) && $qStringArr['ref'] != ''){
//esri.request call with referrer
if($qStringArr['ref'] == 'https://theReferrer.com/imLookingFor.html'){
$data = array(
'username' => 'auser',
'password' => 'auserpassword',
'client' => 'ip', //for dev only, switch to http referr on production
'ip' => '123.123.22.41',
'expiration' => '60',
'f' => 'json'
);
$postData = http_build_query($data);
$targetUrl = "https://gis.ourdomain/arcgis/tokens/generateToken";
}
else{//referrer didnt match, return junk response
echo json_encode(array('token'=>'noToken'));
exit;
}
}
else{
//continue w/ normal proxy call
$postData = file_get_contents("php://input");
}
//omitted cURL options array
$response = curl_exec($session);
echo $response;
... View more
03-22-2013
08:50 AM
|
0
|
0
|
1848
|
|
POST
|
that could be the reason why you can't edit existing features. I'm using a feature service. As a test you could add this to your web map using the add -- layer from web -- http://sampleserver5.arcgisonline.com/ArcGIS/rest/services/Energy/HSEC/FeatureServer/0 This is a sample featureService from esri.
... View more
03-22-2013
08:25 AM
|
0
|
0
|
1915
|
|
POST
|
I have an ArcGIS.com personal account and a Nexus 7 with Collector. I can create maps in ArcGIS Online which contain editable layers and view them in Collector. But tapping the arrow to the right of the result window shows only options Show Details and Zoom To. Edit Feature and Delete are not available. Based on what I'm reading in this thread, these options are not available because I have only a personal account. Is this correct? i have a personal account and iPad using collector for iOS. I can select an existing point and tap the arrow to the right of the result window and see all the options including edit feature and delete. is your 'editable layer' in your arcgis online map a feature service on a arcgis server?
... View more
03-22-2013
04:52 AM
|
0
|
0
|
1915
|
|
POST
|
am i missing something? requirements: free arcgis.com account feat. service w/ editable sde feat class arcgis.com web map collector app -created FeatureServer service on our arcgis server that contains a sde feat. class. -logged into arcgis.com free account -created a new web map, added the feat. service layer (it was secured), saved the web map. -installed the collector iOS app - logged in using my arcgis.com login, saw the web map, loaded it, -logged into the feat. service -collected pts, attributes, photos, ect... back at the arcgis.com web map all collected pts visible, along w/ attributes & photos. Point being, no organizational account, portal or subscription was used. if I remember correctly, Arcgis online was started free, and now seems like it's being pushed to customers over arcgis for server. It's unfortunate that even though you own a server and can publish services, you are somewhat limited in their consumption. When the 'free' plug does get pulled on the collector, (even for arcgis for server customers), I'm sure it eventually will, we'll just code our own JS mobile app; easy enough, but it can't be done in a hour like setting up the collector app.
... View more
03-20-2013
03:50 PM
|
0
|
0
|
1915
|
|
POST
|
are you certain your featureLayer is editable? may be worth throwing it into a arcgis.com map and attempting to create a feature. Maybe an error with the sde gdb and not your app.
... View more
03-20-2013
12:38 PM
|
0
|
0
|
2229
|
|
POST
|
all of the above auto assigning a token based on referrer is because we do not have control of the sharepoint site containing the link. Another idea is to supply the client with a simple $.ajax call to obtain a token before leaving the sharepoint site, then include it in a query string to the JS app, which would then assign a credential using the ?token= from the qs. If the token's invalid, identityManager would challenge for username/pw. users requesting the JS app not originating from the sharepoint site would obiv. not have a token in the qs. this better then the referrer method?
... View more
03-19-2013
06:08 PM
|
0
|
0
|
1848
|
|
POST
|
thanks for your response I should have explained a bit better, the sharepoint site is outside of our control and in inside the GOV firewall. In order for users to access the sharepoint site, they have to authenticate using a GOV system, again which is out of our control. On this sharepoint site, a link will be created to our JS app on our internal server. If users have privs to access the sharepoint site, then they also possess privs to view our JS app and the secured GIS data it consumes. Since we have no way of accessing the user's GOV credentials, I want to grab the referrer when they arrive at our JS app, then return a token accordingly. If the referrer doesn't match the sharepoint site, continue with JS app auth. like normal challenging for username/pw. This is impt, because our JS app is also accessed from outside the sharepoint site; in which case the users should be prompted for creds. I ended up switching to the php proxy out of familiarity w/ php. In the proxy I parsed the QUERY_STRING into assoc. array, check for ref array key, test if ref value matches sharepoint site then set cURL parameters accordingly. If the checks pass, the cURL call uses a hard coded username/password listed in the proxy; else uses the POST credentials. this is the only way I could fig. out how to send the referrer to the proxy onLoad. The callbacks are only concept at this point, haven't got that far yet. think this will work?
function init(){
esri.config.defaults.io.proxyUrl = "proxy.php";
var ref = document.referer;
var request = esri.request({
url:window.location.href,
content:{
ref:ref
},
handleAs:"json"
},{useProxy:true});
function suc(response){
var idString = dojo.toJson({ "serverInfos": [serverInfo],
"credentials": [{
"userId": rahul,
"server": "http://myserver:8399",
"token": this.token,
"expires": this.expires,
"ssl": false,
"creationTime": creationTime,
"resources": securedServices
}]
});
// store it client side
if (_supports_local_storage()) {
window.localStorage.setItem(this.token._jsAPIIDManagerData, idString);
} else {
dojo.cookie(this.token._jsAPIIDManagerData, idString, { expires: 1 });
}
loadcredentials();
}
function err(response){
console.log('response');
}
request.then(suc,err);
}
... View more
03-19-2013
03:18 PM
|
0
|
0
|
1848
|
|
POST
|
we have a client that uses a secured sharepoint site. They want to include a link to gis.ourJSapp.com from their secured sharepoint site. So, anyone that comes to gis.ourJSapp.com from the sharepoint site has privs to access the app; they don't want to have to login again, which is the case right now. Could anyone shed light on some server side code/concepts that would detect http referrer, then either hard-code token or not? I've read through this thread and it's close... http://forums.arcgis.com/threads/73298-Possible-to-hard-code-credentials maybe a .php script before the current proxy.ashx?
... View more
03-18-2013
10:35 AM
|
0
|
6
|
5769
|
|
POST
|
I been trying to applyEdits to a feature and after I hit this error I cannot use the dojo.connect(layer, "onEditsComplete", function(add, updates, deletes)... to further update the feature TypeError: Unable to get value of the property 'getCellsInExtent': object is null or undefined[\code]
any idea what causes this error? the featLayer that your applying edits to...is it currently within visible scale range?
... View more
12-31-2012
09:22 AM
|
0
|
0
|
1290
|
|
POST
|
i'm not a developer either, I just try to be. This day-in-age, when your boss wants to build an app, you step to the plate IMO. The labor pool is too large and employers are squeezing every skill out of workers or else. 2 yrs ago, I hadn't written a single line of code, and now I can say i'm somewhat proficient in PHP, JS, HTML & Python. Its fun, and not that difficult, like i said above, it's all in the samples and API reference. Esri has done a nice job putting the help ref's together, I don't think they should have to code our apps for us.
... View more
12-31-2012
09:14 AM
|
1
|
0
|
2317
|
|
POST
|
In my experience, the problem with the app builders, or 'viewers' is the limited capability. Don't get me wrong, the dev teams at esri have done a great job with the builders, but 9 out of 10 apps you create using them will leave you, or your client saying "i with i could____" or "can you add a____". This leads the developer to jump head-long in the silverlight or flex API and doing away with the app builder. Once you get the gist of it, it's pretty easy to wire a few JS API samples together to create a 100% customized app that your clients will be extremely happy with. An added bonus is no required flash player or silverlight install...which is problematic when clients do not have admin. privs. on their PC's. Just my 0.2 cents.
... View more
12-31-2012
06:33 AM
|
1
|
0
|
2317
|
|
POST
|
shouldn't be too difficult to use the selectFeatures method on a featureLayer (or maybe queryTask not sure), then pass the results to an attributeInspector...all outside the map. Some identifier will have to be added to the feature attribute table when the feature is created by team1, which indicates that attributes still need to be added. Team 2 loads your form, which could auto-query for all features with the above identifier, and onAttributeChange, the attribute edits are applied & the identifier is cleared. I don't see any reason to do this outside of the JS API (SQL, PHP, ect...) especially when all the tools are right here, with accessible reference and samples. Sounds like a fun project.
... View more
12-12-2012
05:06 PM
|
0
|
0
|
2394
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 2 | 06-19-2026 05:33 AM | |
| 1 | 05-02-2024 04:44 PM | |
| 1 | 11-04-2025 11:45 AM | |
| 1 | 10-31-2025 06:53 AM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|