(Facebook C# SDK) Problem getting an access token

前端 未结 3 1820
面向向阳花
面向向阳花 2021-01-22 12:01

I\'m quite new to the Facebook C# SDK (5.0.3) which probablly is the reason for this question. Basically, I\'m trying to get the current users profile, email, photo, etc etc. B

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-22 12:29

    In both the code request and access token request the redirect_uri must be the same, this will fix the OAuthException in the end. My code is now something like:

    ...    
    if (result.IsSuccess)
    {
        var tokenresult = cl.ExchangeCodeForAccessToken(result.Code, new Dictionary { { "redirect_uri", "" } });
    }
    ...
    

提交回复
热议问题