Esri / landscape-modeler-js

A JavaScript web application for designing, running, and saving weighted overlay models using the Esri ArcGIS API for JavaScript and ArcGIS Server image services.
http://landscapemodeler.arcgis.com/
Apache License 2.0
29 stars 17 forks source link

Deployed web app must be registered before OAuth accepts URI #22

Closed skocher42 closed 10 years ago

skocher42 commented 10 years ago

I've deployed the Landscape Modeler web app on my ASP.NET web server, but when I try to hit the URL for index.html and the ESRI authentication prompt accepts my credentials, I see in the console "[OAuth Error]: invalid_request - Invalid redirect_uri" once the authentication tries to redirect to the original URL.

Does the web app on my web server need to be registered somehow with my ESRI account or group, in order for the URL redirect to work?

The web app is installed at http://indusspatial.induscorp.com/cstat/landscape-modeler/index.html, my login is skocher_EPA2.

thanks Scott

tomwayson commented 10 years ago

Good question Scott.

You will need to create your own ArcGIS Online/Portal item for your app with it's own app id, then register the above URL with that item, and finally update /src/app/config.js to use the new app id as follows:

    // oAuth
    oauthOptions: {
      appId: "your-new-app-id-goes-here",
      portal: portalUrl,
      expiration: (14 * 24 * 60), // 2 weeks, in minutes
      popup:      false
    },

We should probably include this in the readme and/or docs.