-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using with non-federated (standalone) servers not associated to portal #604
Comments
You should be able to follow the flow of this here https://github.com/Esri/arcgis-rest-js/blob/master/packages/arcgis-rest-auth/src/UserSession.ts#L825-L900. But if you don't want to parse the code here is what we are doing:
I'm going to guess that you just have a configuration of server that we haven't encountered before. Could you do the following to help us debug:
|
see #423 |
You can use generateToken() directly against the server token endpoint using a built-in server user where the the token url is something like |
Thanks for all the info guys. I have the method that @COV-GIS mentioned working. I'm going to investigate further to see why I was encountering the error. I'll follow up with more details shortly |
@patrickarlt here's my json. I don't believe there's anything special about this, I was probably just incorrectly using the library. {
"currentVersion": 10.71,
"fullVersion": "10.7.1",
"soapUrl": "https://services.wsbeng.com/arcgis/services",
"secureSoapUrl": null,
"authInfo": {
"isTokenBasedSecurity": true,
"tokenServicesUrl": "https://services.wsbeng.com/arcgis/tokens/",
"shortLivedTokenValidity": 480
}
} |
Okay - here's what I'm doing to get that error: const authentication = new UserSession({
server: arcgis.url,
username: arcgis.username,
password: arcgis.password,
tokenDuration: arcgis.tokenExpires,
});
const defaultParams = { ...DEFAULT_PARAMS };
console.log(defaultParams);
const layerProps = config.featureLayer;
const layerUrl = `${layerProps.url}/FeatureServer/${layerProps.layerId}`;
// I think we need to do this in order to use the authentication in requests?
await authentication.getToken(layerUrl);
//...further down
const deleteResult = await request(`${layerUrl}/deleteFeatures`, {
authentication,
httpMethod: 'POST',
params: {
...defaultParams,
where,
}
}); This throws |
that isn't necessary. anytime you pass what is
|
Its just the arcgis server root: |
Funny I got it working. I just removed the last slash. I'm tired today and can't follow the docs. I just looked over them again and saw that you guys don't pass the last slash and that's what did it for me. Thanks for the troubleshooting guys! |
not your fault.
should be: const [root] = cleanUrl(url).split(/\/rest(\/admin)?\/services(?:\/|#|\?|$)/) |
Is it possible to use this library with standalone servers for making basic rest requests against a standalone arcgis server? Meaning not federated or trusted by any portals, I just want to generate an arcgis server token and make requests against the endpoints.
I'm running into errors thrown in this library that say the server cannot be trusted since its not a federated server...etc I am hoping someone here may know more about this.
The text was updated successfully, but these errors were encountered: