Make Google Recaptcha work with special characters in the domain name

I created an API key for a site with the Swedish charachter ä in the domain name ( http: //sälja.io ), but it was not initialized by recaptcha.

Then try the api key for the equivalent url http://xn--slja-loa.io , which worked when reaching the site with http://xn--slja-loa.io but not http: //sälja.io .

Then I found a secure token that should work on all domains. He initialized recaptchas on all domains and also worked on all tested domains except those who have ä in it . https://developers.google.com/recaptcha/docs/secure_token

Is there a way to make it work also with ä in a domain name?

Edit

Since the api key for http://xn--slja-loa.io works from android when accessing the site from http: //sälja.io , the browser may interpret the domain. For example. firefox interprets http: //sälja.io as the domain http: //sälja.io and cannot receive a response from google servers that will not allow ä in domain names. Android inteprets http: //sälja.io as http://xn--slja-loa.io and will receive as it does not contain ä. Any thoughts on this? Is there a way to make the browser interpret http: //sälja.io as http://xn--slja-loa.io ?

Edit2

Code examples can be found at sälja.io / test, 178.62.187.163/test and xn--slja-loa.io/test

Edit3

Today (11/25/2015) it seems that you cannot use recaptcha with a special character like ä in the domain name. Since Aishvat Singh helped most to reach such a conclusion during this time for generosity, he will be rewarded, however, an answer will be accepted when a solution can be provided for this problem.

+8
javascript recaptcha cross-domain
source share
2 answers

I tried this now and I can generate a key for example-ä.se 6Ld8VRETAAAAALRXFNxmjEeVzbg2y5vdWv7THwJz

will publish a full working example soon


EDIT 1

Here's a git repo for code the same as on heroku

Well, this is not a complete fix because I used herokuapp.com as a domain, so example-ä.herokuapp.com becomes a subdomain and works

(however, when I tried earlier, he created a key for example-ä.se too, but when loading the page in captcha it gives an invalid domain , it turned out that this was the original problem, I thought you could not generate a key for this domain )

Will try to perform a full fix


EDIT 2

Btw you can also specify your domain IP address, check the discussion

For me, the free heroku account does not provide an ip domain, so it's hard for me to test it

Also I read this thread

It turned out that if I specify the list of domains as soon as com , it accepts. In your case, just specify se as domains and it should work, google does not check the exact url, it just checks the domain

domain description

Hope this stoken also at the stoken approach

+4
source share
-one
source share

All Articles