nov/fb_graph — Issue #135: code vs signed request for getting page information.
Author: anuragphadke19
Created: 2011-10-14 03:37:11+00:00
State: open

For users who are successfully authorized by my app, I get signed request which has page as well as user data.

However, when a user has just authorized my app, I get only the "code". From the "code", I use the following code to get the access token - but i want the current page information like the page id. How can I get that information??

if params[:signed_request].nil?
if params[:code].nil?
logger.debug "both signed request and code is empty."
#redirect the user to error page.
else
logger.debug "code is "+params[:code]
client = Facebook.client
client.authorization_code = params[:code]
access_token = client.access_token! # => Rack::OAuth2::AccessToken
logger.debug access_token
end
end