Error message: Invalid redirect_uri, Error: 400

1683
1
05-24-2017 10:17 AM
JoseSanchez
Occasional Contributor III

Hello everyone,

I am getting the error message below. I am getting this error every time I deploy an WAB/ASP.net application. I was able fix it before but now I am having trouble finding the reason why it is not working.

Error: Invalid redirect_uri

ArcGIS Portal Directory | Home
Error

Invalid redirect_uri


Error: 400

This error happens when  I deploy my WAB application to a new server, in this case the staging server. Before I was able to fix this issue changing the IIS authentication settings.

This is what  I am doing:

- create application in Web Application Builder in my workstation,

- download the application locally,  create a virtual directory in IIS in my workstation pointing to it

- open the web application with Visual Studio 2012, using the option "Open web Site" and customize it in my workstation

- with Visual Studio 2012, publish the application on the staging server

 - In the staging server with IIS:

       .  Create IIS virtual directory

       . Add application

       . In the authentication settings enable Anonymous and Windows authentication

       . Under Edit Permissions, Security tab, created account IIS_IUSRS

       . 

 When calling the web application:

  -  http://[stagingserver]/myapplication  it opens, but after clicking  OK on "Please Sign In" to continue, it pops up a window "Error message: Invalid redirect_uri, Error: 400. See attached image file. I tried to open this same rl in several workstations and it fails

 -  if I log on on the staging server and run the application http://localhost/myapplciation/  It works fine.

I also did another test, creating an IIS virtual directory and application pointing to the server //[stagingserver]/myapplication  and it fails too.

Any ideas of what I need to check to fix this issue? 

PS: Some additinal information that might help.

The Web Adaptor installed in my is located in another server http://[anotherserver]:6080 

0 Kudos
1 Reply
JoseSanchez
Occasional Contributor III

FOUND IT!!!!!!!

I spend several days trying to figure out why I was getting this error. First I focused on the IIS Web application that was deployed to a staging server. In this application I changed several parameters related to IIS, authentication and security permits, but it did not work. Then  I copied the application into another server and I was getting the same error. 

Finally the issue was in the web mapping application located in our  [http://[MyCompany].maps.arcgis.com ] and used by the application in the  config.json "appId" . It was referencing another server, not the one I am currently deploying.

 To correct this issues this is what  I did:

 -  select the tab "Settings" and verify that the value URL in

Web Mapping Application Settings points to your web application.

 - Also please check the 

App Registration

 

and add your new server in the list of servers.

See attached jpg images for additional information.

0 Kudos