2

The following URL causes an OAuth exception. I have no idea why this is as locally this is working OK. It is only when it is on the domain does it fail. The app is configured correctly each time in the Facebook App. Note this is using the FacebookScopedClient code Here. Any direction would be appreciated

URL

https://graph.facebook.com/oauth/access_token?client_id=52*********37&redirect_uri=http%3a%2f%2ffreersvp.mytakeawaysite.com%3a80%2fAccount%2fExternalLoginCallback%3fReturnUrl%3d%252FDashboard%26__provider__%3dFacebook%2bPro%26__sid__%3d3c92eb7e84304afc931ef0ea7b62f56a&client_secret=2123***********4256&code=AQAQIJsj-ondldllVYKdpxJaZouqrlg9sjTcfUxyWhAw8MXbD2DvsOSujg2m7E3s3cvNusCI0ZZoJAuGgu_FLkPyjYMQAkTWDVyHTcAoJD-tezyXgn0vhoFzX3FmuRBHYpyJEM-dk0KgF5ugsTHo9yGjBjrcfMDUGu9IxkKQ36k3gMrwocM1_l5t342Q2kIOHdt8pPcyrs--NzgNyZv48vSq7jkZwuQ95xRjUHG5J-ptcgq0l2BlqjzHDDuvIFH23lpMWHzzqdejdj5ejukz7t_Fnhx-mrpVdcRYhP3JeZ2UOTjAyKQmUB3rInooECcjq4c

Exception

{
       "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
       }
    }
CR41G14
  • 5,464
  • 5
  • 43
  • 64
  • is your `ExternalLoginCallback` correct? – Christian Phillips Sep 14 '13 at 16:40
  • Hi christanddev what do you mean is it correct? the callback goes to an action called ExternalLoginCallback – CR41G14 Sep 14 '13 at 21:39
  • 1
    You seem to have a nested url featuring a `/` in your redirect_uri ( `...?ReturnUrl=/Dashboard&__provider__=Facebook` ) If so, this answer http://stackoverflow.com/a/5389447/1236044 might solve your problem (the base64 encoding seems promising) – jbl Sep 19 '13 at 15:37

3 Answers3

0

try this uri

m_OAuthURL = new Uri(
    string.Format(
          "https://www.facebook.com/dialog/oauth?client_id={0}&redirect_uri={1}&&scope={2}&response_type=token", 
          AppID, RedirectUri, Scope));

when you use this redirect uri:

string k_RedirectUri = "https://www.facebook.com/connect/login_success.html";

hope it will help for me it works fine.

iabbott
  • 873
  • 1
  • 8
  • 23
NoahBon
  • 1
  • 2
  • 4
0

Check the URL in the Facebook app config and make sure you have correctly configured.

  http://www. or http://

also make sure to check the trailing slash.com/

stink
  • 865
  • 8
  • 19
0

Just make sure that the redirect_uri in both /dialog/oauth and /oauth/access_token is the same.

thangcao
  • 1,819
  • 1
  • 13
  • 14