mkdynamic/omniauth-facebook — Issue #25: Facebook Canvas issues?
Author: boxfirepress
Created: 2012-01-27 16:20:56+00:00
State: open

I'm having trouble authenticating within Facebook's canvas... currently, I detect for the signed request like so:

```ruby
def signed_facebook_request?
if params[:signed_request]
session[:canvas] = true
fb_data = parse_signed_request(FB_CONFIG['secret'], params[:signed_request])
uid = fb_data['user_id']
unless @auth = Authorization.find_by_provider_and_uid('facebook', uid)
redirect_to "/auth/facebook/callback?code=#{fb_data['oauth_token']}"
else
self.current_user = @auth.user
end
end
end
````
But, I get an invalid credentials response ... I thought, looking through the code, the callback would take the oauth token from the signed request and go from there, but is that not the case? Or am I doing something clearly wrong in the redirect?