-
Notifications
You must be signed in to change notification settings - Fork 83
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
DotNet Proxy isn't working #538
Comments
hey @randomblink I think this comment might be what you need. myTemplate.startup().then(function (config) {
urlUtils.addProxyRule({
urlPrefix: "prefixToServiceUrl", // Does this look right? This is what worked when testing with AppBuilder
proxyUrl: config.proxyurl
}); https://developers.arcgis.com/javascript/3/jsapi/esri.urlutils-amd.html#addproxyrule Basically, you need to tell esri.urlUtils to use your proxy for a specific URL. Let me know if that works and that is it and I'll update the readme to cover this. -Matt |
Here's my problem... I'm not sure what I need to use for the 'prefixToServiceUrl' entry... Here is the url to the AGOL Application: Since we host the Rest Service on our own ESRI Server should I point to the rest service directly? AND how should I configure the Proxy rule in the Proxy.config file? |
For an example: I entered the following... index.html
and
Then I added to the proxy config like so... proxy.config
But it does not work... |
hey @randomblink, The URL prefix should be the URL to the rest service, not the portal item like I see above. It should only be a partial URL up to the service so that it can perform queries on the service and be able to identify that it should use the proxy. For example the following prefix would proxy anything after
So this would work:
Everything else you have looks good. |
The current rest service that this is feeding from is located on our ArcServer. When I use that URL the geoform still doesn't work. When I hover of the App ID in the login form I get the following URL. But using that URL the geoform still doesn't work. |
Can you see if the network tab is using the proxy when calling for the service? That's a good first step. If not, make sure you have the proxyUrl set int he config.js as well. If that doesn't work, try adding proxy rules for the rest URL without the http/https. like so: urlUtils.addProxyRule({
urlPrefix: "route.arcgis.com",
proxyUrl: "<url_to_proxy>"
}); |
Yeah I don't think that will work. I think you need the actual URL to the rest service, not to the portal item. For example: {
"serverUrl" : [
{
"url": "http://route.arcgis.com",
"oauth2Endpoint": "https://www.arcgis.com/sharing/oauth2",
"clientId": "6Xo1d-example-9Kn2",
"clientSecret": "5a5d50-example-c867b6efcf969bdcc6a2",
"rateLimit": "120",
"rateLimitPeriod": "60",
"matchAll": true
}
]
}, So in the index addProxyRule, you need a partial match to the service URL, not the portal item and in the proxy.config you need the same for the url. |
You should be able to go to the item in your portal and view the service URL to the rest service. |
Even if the service URL is on an ArcServer and not AGOL? |
yeah, like that... so the partial would be: |
We'll get this working :) If I cant get it working ill find someone who will |
Did the partial in index.html, no go. |
I think the best thing to do now would be to start debugging it. Open up the console and network tab and see what URL is prompting the identity manager to request credentials. Maybe post a screenshot of the network tab and we can see if its even going through the proxy or if it is going through it but the credentials aren't working. |
Here is the CONSOLE tab... Here is the NETWORK tab... I'm not seeing anything... |
It doesn't look like the proxy is even looked at. Which is frustrating. But seems apropos. |
Yes, it looks like its the org item that is prompting the proxy. So we need another entry for that in the proxy config.
And add another proxy rule: urlUtils.addProxyRule({ |
Added those both and got the same... |
In the network tab, click on the Also make sure that in your app in the |
I tried adding in those urls... Both to index.html and proxy.config with no luck. |
Can you share the network request for the item beginning with "1e..." Is that trying to go through the proxy at all? |
Does not appear to be trying to go through the proxy. |
Wait... the RESPONSE for this entry shows the following. {"error":{"code":403,"messageCode":"GWM_0003","message":"You do not have permissions to access this resource or perform this operation.","details":[]}} |
yes, but its not prompting the proxy. So add another proxyrule for |
Also make sure the proxy.config has an entry for ^ make sure its https. Might be good to have one for Once the proxy is being prompted than we can work on getting the proxy to handle credentials. First step is to get it redirecting the URL to the proxy. |
Still not working |
Make sure to add the proxyRule before the https://user-images.githubusercontent.com/235770/31399077-a9836d5a-adb0-11e7-8f90-197574b1c84a.png |
I'm thinking the item is being requested before the proxyRule is in effect |
Ok... We might be getting closer. |
Yes! some progress. It is going to the proxy now but credentials arent working. So now we just need to get the proxy.config to pass the correct credentials to the correct urls. The clientId and clientSecret are valid right? And the Urls are matching? Make sure that urls have both http and https if a request is going via http. |
Looks like the item one isn't returning anything. it should return data for the item. |
I'll be back to this later. I have to eat. It's almost 2:30pm here. Sorry. |
Ok... I have returned. |
Just need to figure out which URL is not returning the data needed and then add it to the proxy config to pass authentication through. |
I think it's this one: But at this point I'm so lost... |
What is the |
looks good...
No that should be fine. I'm lost too :( |
I'm adding the mapid. |
It looks like in your proxy.config you're using |
or you use |
IT WORKS!!!! |
cool! you might just be able to use up to the |
That is correct. I used the following... proxy.config index.html But I included both the WEBMAP ID and the APP ID in the default.js. |
This issue thread has been hugely helpful for me, but I have not quite gotten it working. I've created a new issue here. Perhaps someone has some insight? |
I've configured the GeoForm per ALL instructions. But the proxy isn't working.
The geoform is on an INTERNAL ONLY server. The AGOL Feature Layer and WebMap and Application are all shared with the Organization. I've got ClientID and ClientSecret setup in the proxy.
Nothing... it asks for sign on everytime.
The text was updated successfully, but these errors were encountered: