facebook Access Token 400 bad request

允我心安 提交于 2019-12-03 13:22:05
  1. Check you are adding correct code in the url For example

    http://www.xyz.com/?code=AQC399oXame3UKmoAMYnqkZOEXPDNa8ZUFEY9sc6I4YNQnNT-ZgHzpMNnQVZrCUBZVqJRIB1QrXC5xW58_8MNIgQol_PaQvYssUM8OiKjSY5aoqGLBMuCeeHsSqP_mRTd1xiK0iretZcXwMm_27lFYrWFw345Mxod_lfJuB8zI13E8wJUQiArXW_ZlGLNcyxh20#_=_
    

Code must be

    code = AQC399oXame3UKmoAMYnqkZOEXPDNa8ZUFEY9sc6I4YNQnNT-ZgHzpMNnQVZrCUBZVqJRIB1QrXC5xW58_8MNIgQol_PaQvYssUM8OiKjSY5aoqGLBMuCeeHsSqP_mRTd1xiK0iretZcXwMm_27lFYrWFw345Mxod_lfJuB8zI13E8wJUQiArXW_ZlGLNcyxh20

code should not include following in the end

    #_=_ 

If above did not solve the problem


2. redirect_uri must end with /

redirect_uri=http://www.xyz.com/

The following gives some times above mentioned error

redirect_uri=http://www.xyz.com


3. A lso make sure App on Facebook and Website with Facebook Login are set with same addresss e.g http://www.xyz.com/

You need to send the user to the Facebook Login page to get a valid code. The code should then be used to get the access_token for the user.

Follow the Authentication Guide.

I also got error message 400, when my app id and secret were wrong (i had messed up develop and production id-s and secrets).

Fixing them (watch also out for the correct host) fixed this problem for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!