Failed to obtain access token in Facebook

I'm using the facebook strategy for passportjs and I'm getting this error

"failed to obtain access token (Error: Hostname/IP doesn't match certificate's altnames)"

Basically, this happens when the client (in silverlight) is hosted in another server and it uses the server where this authentication module is. So the authentication is going in different servers before it goes back.

Please help. Thanks.

All requests need to come from and return to the domain that is on file with facebook. If you registered yourdomain.com with facebook, all requests and redirects must go to xxxxxx.yourdomain.com. You can set it up in your host files to use the fully qualified name in all your requests.

try something like

String token = mSocialAuthAdapter().getCurrentProvider().getAccessGrant().getKey();