Facebook redirect url issue OAuthException

前端 未结 8 1963
北海茫月
北海茫月 2020-12-05 14:23

My app was working well for long time, but now I am getting the error from Facebook saying:

Content: {\"error\":{\"message\":\"Error validating verification c

8条回答
  •  离开以前
    2020-12-05 15:08

    Mo Hrad A is right, I didn't even manage to use $ character.

    I wrote 2 simple functions that allows me to use complex return urls with parameters:

    public static string EncodeFacebookReturnUrl(string url)
    {
        return Regex.Replace(HttpUtility.UrlEncode(url), "%", "_-_");
    }
    
    public static string DecodeFacebookReturnUrl(string url)
    {
        return HttpUtility.UrlDecode(Regex.Replace(url, "_-_", "%"));
    }
    

    Translating with UrlEncode results in only 1 "illegal" character (%), which I'm replacing with the legal string _-_. Makes it simple to decode too.

提交回复
热议问题