Skip to content

More DotNet proxy help #549

@pdenny

Description

@pdenny

With the help provided in issue 538, I've been able to make quite a bit of progress in getting my GeoForm up and running through a proxy. At this point it appears that while I am able to get the GeoForm app to authenticate, the webmap it uses remains unavailable.

In geoform/config/defaults.js:

...
    "appid": "0212e67f6bba4a37a18b49e5f6e1ec7a",
    "webmap": "430d8cb4ab77479c88342a933255edf7",
    "sharinghost": "https://mapportaltst.matsugov.us/arcgis",
...

I haven't seen much about the oauthappid key... should I be using that at all? I am not currently, though I have tried without success. When I give the key a value, instead of the username/password login in for the webmap, I get this sign in dialog:
signindialog
It opens a Request for Permission page with a url like https://mapportaltst.matsugov.us/arcgis/sharing/oauth2/approve?oauth_state=3iaIUXJ.... When I click the approve button on that page, I get a 404 error.

In dotnet/proxy.config

...
        <serverUrl
            url="https://mapportaltst.matsugov.us/arcgis/sharing/rest/content/items/"
            oauth2Endpoint="https://mapportaltst.matsugov.us/arcgis/sharing/rest/oauth2/"
            clientId="XXXX"
            clientSecret="XXXX"
            rateLimit="600"
            rateLimitPeriod="60"
            matchAll="true" />
...

In geoform/index.html:

...
        require(["config/templateConfig", "application/template", "application/main", "esri/urlUtils"], function (templateOptions, Template, Main, urlUtils) {
            // start template
            var myTemplate = new Template(templateOptions);
            // Begin my addition
            urlUtils.addProxyRule({
                urlPrefix: "https://mapportaltst.matsugov.us/arcgis/sharing/rest/content/items/",
                proxyUrl: "http://prttst/DotNet/proxy.ashx"
            });
            // End my addition
            // create my main application. Start placing your logic in the main.js file.
            var myApp = new Main();
...

In the proxy log:

2018-04-02 16:36:31 URI requested: https://mapportaltst.matsugov.us/arcgis/sharing/rest/content/items/0212e67f6bba4a37a18b49e5f6e1ec7a?f=json
2018-04-02 16:36:31 Matching credentials found in configuration file. OAuth 2.0 mode: True
2018-04-02 16:36:31 Service is secured by https://mapportaltst.matsugov.us/arcgis/sharing/rest/oauth2/: getting new token...
2018-04-02 16:36:31 Sending POST request: https://mapportaltst.matsugov.us/arcgis/sharing/rest/oauth2/token?client_id=XXXX&client_secret=XXXX&grant_type=client_credentials&f=json
2018-04-02 16:36:32  Token obtained: QsJSMLADCORU63Sz-J99D93dDPpORuVlAWKyqevsG1JIr9iJ7E9wptp63-Edsoh7yG5iruqN5WxEyKJTv_szUwCGtEGSwPGviLfqRwrM32OLISubELs1wagbq4e4tNuZrYoWWu8dH9HzmTd3SgkHMw..
2018-04-02 16:36:32  Exchanging Portal token for Server-specific token for https://mapportaltst.matsugov.us/arcgis/sharing/rest/content/items/...
2018-04-02 16:36:32 Sending GET request: https://mapportaltst.matsugov.us/arcgis/sharing/rest/generateToken?token=QsJSMLADCORU63Sz-J99D93dDPpORuVlAWKyqevsG1JIr9iJ7E9wptp63-Edsoh7yG5iruqN5WxEyKJTv_szUwCGtEGSwPGviLfqRwrM32OLISubELs1wagbq4e4tNuZrYoWWu8dH9HzmTd3SgkHMw..&serverURL=https://mapportaltst.matsugov.us/arcgis/sharing/rest/content/items/&f=json
2018-04-02 16:36:32  Token obtained: oA35ErvMaawJ1pLVKIG4d8qoCJTotnVhnxYZimUISVhhiXSPU-TvUvKZfsKaTuC5BpHneG6Elem0DPxng4l07cPKSXGJkGQwHmrHK02FHbjla1QJv71RJJFLFtJbs8JXoaa_0gy8M0sD9TgbyU6eyw..
2018-04-02 16:36:32 URI requested: https://mapportaltst.matsugov.us/arcgis/sharing/rest/content/items/0212e67f6bba4a37a18b49e5f6e1ec7a/data?f=json
2018-04-02 16:36:32 URI requested: https://mapportaltst.matsugov.us/arcgis/sharing/rest/content/items/430d8cb4ab77479c88342a933255edf7?f=json

And just to be extra verbose, here are some screen shots that I think are pertinent from the Network page of the Developer tools when loading the GeoForm (which stops at the username/password dialog):
1
2
3
4
5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions