Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

{ "error": { "message": "Missing client_id parameter.", "type": "OAuthException", "code": 101 } }

Im following Ryan Bates Screen Cast #360 Facebook Authentication...

When i get to to part where i click the link to log into facebook i get a

{
   "error": {
      "message": "Missing client_id parameter.",
      "type": "OAuthException",
      "code": 101
   }
}

i tried restarting the server like previously stated Im pulling my hair out trying to figure this out

My site url at facebook development page is correct i've followed his steps hundreds of times

like image 361
user1502223 Avatar asked Sep 06 '12 01:09

user1502223


1 Answers

May be you have not setup the env for FACEBOOK_KEY and FACEBOOK_SECRET

In terminal (if you are using linux or mac)

$ export FACEBOOK_KEY=zzyzyzyzyzyzzy
$ export FACEBOOK_SECRET=zzyzyzyzyzyzzysbdbdsndnds

#now start rails from same terminal
$ rails s

this will now pass the values of FACEBOOK_KEY and FACEBOOK_SECRET to application.

Or second option

provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET']

to this

provider :facebook, 'FACEBOOK_KEY', 'FACEBOOK_SECRET'

Diff between using two approaches.

The drawback of second type is, you need to keep the keys into the code repository. which is not a safe approach.

like image 66
Pritesh Jain Avatar answered Sep 22 '22 18:09

Pritesh Jain