DotNetOpenAuth CTP - Facebook bad request

前端 未结 5 609
灰色年华
灰色年华 2020-12-23 18:41

I am trying to use the CTP to connect with Facebook over OAuth 2.0.

I can get the initial request to Facebook working OK, but when it comes back and we call:

<
5条回答
  •  难免孤独
    2020-12-23 19:05

    I've been, intermittently, experiencing this same issue myself when I was utilising the returnTo parameter of WebServerClient's PrepareRequestUserAuthorization(). Only certain returnTo URIs would experience an issue... the URIs I was passing in had a Base64 component to them. Some of which contained a = in them. If I URL Encode these URLs I get "A potentially dangerous Request.Path value was detected from the client (%)" error from my local server.

    Until I can find a, better, solution I am performing some prodding on the string before passing it in;

    localReturnTo = localReturnTo.Replace("=", "_")
    

    Then when I receive my response I perform the reverse;

    returnedUri = returnedUri.Replace("_", "=")
    

    It's not pretty. But it does get around the immediate (similar) problem I was experiencing.

提交回复
热议问题