I'm trying to do server-side auth with facebook, i can get to login dialog
and permission, but after redirect i didn't get the auth 'code' in redirect
handler. any suggestion?
FBCfg = &oauth.Config { //setup
ClientId: appId, ClientSecret: appSecret,
AuthURL: "https://www.facebook.com/dialog/oauth",
TokenURL: "https://graph.facebook.com/oauth/access_token",
RedirectURL: "http://"+domain+"/fedlogin/facebook/redir",
Scope: "",}
func FBHandleAuth(w http.ResponseWriter, r *http.Request) {
url := FBCfg.AuthCodeURL("")
http.Redirect(w, r, url, http.StatusFound)}
func FBHandleRedir(w http.ResponseWriter, r *http.Request) {
code := r.FormValue("code")
w.Write([]byte(code)) //<-- empty, no code returned.}
Note: I'm using original goauth2 latest version.
--