-
-
Notifications
You must be signed in to change notification settings - Fork 191
Authentication
nov matake edited this page Mar 4, 2011
·
9 revisions
Assuming you successfully get user approval and facebook set auth cookie.
auth = FbGraph::Auth.new(CLIENT_ID, CLIENT_SECRET)
auth.from_cookie(cookies) # Put whole cookie object (a Hash) here.
auth.user.fetch
auth = FbGraph::Auth.new(CLIENT_ID, CLIENT_SECRET)
auth.from_signed_request(params[:signed_request])
if auth.authorized?
# If authorized, the auth has user and access_token.
auth.user.fetch
else
# First time user, show "Connect" button here.
p auth.data
end