0
votes

I'm developing a website that is going to use Facebook authentication.

I'm using GWT and it works fine when I run the code compiled, but when I'm running the development it does not work.

The problem is when I'm trying to retrieve the access_token from Facebook. I'm receiving the error below:

"error":{"message":"Error validating verification code. Please make sure your redirect_uri     is identical to the one you used in the OAuth dialog request","type":"OAuthException","code":100}"

Obviously, the redirect_uri is identical as the login url one.

I found out (by this topic) that the problem is the last part of the url "?gwt.codesvr=127.0.0.1:9997".

How can I solve this? or how can I manage to use the GWT development mode with this problem?

Thanks,

2

2 Answers

0
votes

Normally this is due to the url verification FB does.

When you register a new app in FB you have to configure the set of domains (App Domains) authorized to use the FB login form.

Unfortunately you cannot set 127.0.0.1 nor localhost as a valid domain, so you cannot use GWT dev-mode unless you configure a hostname in your domain pointing to your localhost.

If you set mydomain.com as a valid App Domain in your FB application, configure localhost.mydomain.com pointing to 127.0.0.1 in your local hosts file or in your DNS server. Then use http://localhost.mydomain.com:8888/myapp.html?gwt.codesvr=localhost.mydomain.com:9997 to run dev mode in your browser.

0
votes

I found out the problem. By encoding only the gwt.codesvr value it works. However, using php urlencode function on it did not work, I had to encode it myself. The gwt dev param ended like this "?gwt.codesvr=127.0.0.1%3A9997"