Web URL parameter causing authentication error

1321
6
09-15-2021 05:20 PM
AdamMesser1
New Contributor III

When populating a survey using web form url parameters, we are receiving a "Invalid redirect_uri  Error: 400". We have a Survey123 edit form which we launch via custom link to pre-populate the form using web form URL parameters gathered from an existing feature service. Staff launch the edit survey by clicking on the link from an internal experience builder lookup, so they are logged into our ArcGIS Online organization. Through removal of parameters and special characters in the links we determined the error is being caused by the @ symbol in the values being sent to an email field. Additionally, the error only occurs if the staff launching the survey have not authenticated to survey123.arcgis.com before to attempting to use the link containing parameters. If the email field is null or the user has authenticated to the survey123.arcgis.com web form already the error does not occur. We only confirmed this on the web browser and did not test the windows desktop app nor mobile apps. Can someone confirm if this is a bug or are we missing something? We were able to overcome the issue (with an undesirable hack), by embedding a blank Survey123 form hidden behind another frame in the experience builder app. This automatically authenticates staff to survey123.arcgis.com before they launch a survey with web form parameters. 

0 Kudos
6 Replies
JamesTedrick
Esri Esteemed Contributor

Hi @AdamMesser1 ,

Can you provide an example of the URL you are using to open the form?  In particular, I'm wondering if the '@' symbol is not being properly encoded - that is a reserved character that shouldn't be in an URL directly.

0 Kudos
AdamMesser1
New Contributor III

Thanks for following up @JamesTedrick .

We are not encoding the link for users, but the redirect (as shown in the attached image) is encoding the @ character as %40. An example of our original link is:  https:://survey123.arcgis.com/share/437eac8e2d174d0a94a05629bc7b3358?open=menu&field:Email_Address=amesser@mt.gov

The encoded redirect is:  https%3A%2F%2Fsurvey123.arcgis.com%2Fshare%2F437eac8e2d174d0a94a05629bc7b3358%3Ffield%3AEmail_Address%3amesser%40mt.gov

We tested encoding the @ symbol when troubleshooting and it did not solve the issue. For example we tried: "https:://survey123.arcgis.com/share/437eac8e2d174d0a94a05629bc7b3358?open=menu&field:Email_Address=amesser%40mt.gov" . We also tried encoding everything after the ? for our full url with all questions. The only thing that worked was getting rid of all @ and all %40 references or ensuring the user had authenticated to survey123.arcgis.com.

0 Kudos
AdamMesser1
New Contributor III

To be clear, this works as expected on a public survey where no authentication is required such as: https://survey123.arcgis.com/share/3feb26125dbc427ea0aec090e7f55b4b?open=menu&field:Hunter=Adam  Messer&field:Phone_Number=406-555-5555&field:Email_Address=amesser@mt.gov

0 Kudos
AdamMesser1
New Contributor III

This issue was logged with Esri support and confirmed as a bug. "#BUG-000143802 Unable to access the Survey123 custom URL while the URL contains the ‘@’ symbol."

LouisDECOMBE
Occasional Contributor

Hi, do we have any solution to this pb since 2021? Thanks!

0 Kudos
LouisDECOMBE
Occasional Contributor

Seems to be good with encodage 

LouisDECOMBE_0-1687966358789.png

 

0 Kudos