Geocoding / Autosuggest not working with restricted API

622
4
05-27-2021 08:26 AM
David_W
New Contributor II

Hi, 

I am trying to implement geocoding / autosuggest on my website. When I leave my API Key unrestricted, all works perfectly fine. As soon as I restrict the API to my domain (https://example.com/*), its not working anymore.

Doesn't it automatically check from which site the request comes? Do I need to send the referrer as a parameter somehow?

Thanks in advance for any help!

David

 

0 Kudos
4 Replies
BjornSvensson
Esri Regular Contributor

@David_W- Does it work if you remove the * from the end of the referrer?
Most browsers no longer send the full referrer URL, only the domain.

To further debug, when using the app, look at the network tab, and see what the sent request header "referer" is set to.

0 Kudos
David_W
New Contributor II

Hi @BjornSvensson - Thanks for your reply. I checked the network tab. My request referer is

 
Now I added the exact same referer to the restriction (without asterisk). But the result is the same, request canceled.
 
Do you have any other ideas what the reason could be?
0 Kudos
BjornSvensson
Esri Regular Contributor

You could try shorter referrers, like https://example.com .
You could try different browsers.

If that doesn't work I would suggest contact Esri Support.

0 Kudos
David_W
New Contributor II

Hi @BjornSvensson , Thanks for your suggestion, unfortunately it doesn't help.

Could you please tell me how to submit a support request as a developer on pay as you go subscription? 

„Request Case“ does not work for me, I get the notice that I’m not connected to any organization. At the same time, I’m admin of my own organization. And if I try to connect to “my organization” and send a request, I never receive it, as the form seams to be not linked to my organization. Somehow everything goes round in circles...

0 Kudos