Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request. If you are getting this error from Facebook, just add trailing slash at the end of your redirect_uri

$redirect_uri = rtrim(redirect_uri,"/").'/';