I am testing a GET request on a development server to exchange a code for an access token.
Oauth form URL:
https://www.facebook.com/dialog/oauth?
client_id=1543358959292867%0A&
redirect_uri=http%3A%2F%2Flocalhost%3A8080%2FFBLoginCallback&
response_type=code&
scope=email+user_birthday+user_about_me
Callback w/code.
http://localhost:8080/FBLoginCallback?code=AQAsGssRxA9nDZ2YQ82Dgdw_NB_MsikZxVanO75QG0hKlH9F49v7CEiu5ssBHLmvF_hc4081Q5KcJq9cgC9pyIacz-ekpL6WKv5x0E12-HRzvR7bSImWJMktfTIfbabIDDy3BsOue2GhGos7qlIbU-XJGrzWMehbEhAb4p-2rpd4bVnIqKvaErU2Ma8onUMM8HICyf7IaArOlZs5VYqQDO0IjxsTot5DdU0j8IyBdmtksdspPK-YMhFcJTXabAxO2tWnvOQhAMCH00rlIByCY-xXMIgiLfrnF_YRrs9x5lU2d8ZF2DZrHgXLfnxH1Hh-bGQ#_=_
I get the following response.
oauth2: cannot fetch token: 400 Bad Request
Response: {"error":{"message":"The username for your HTTP Basic Authorization must be 1543358959292867","type":"OAuthException","code":101,"fbtrace_id":"HTJcNHH6OmY"}}
The issue is that this error occurs on one of my two laptops. They both run the exact same code.
This is the golang function I am using for the exchange.
tok, err := fbConfig.Exchange(oauth2.NoContext, r.FormValue("code"))