We have a problem in our RoR application. We use facebook authentication with omniauth and make friends with Koala. But recently, when we try to show a photo of a friend, we got this error:
Koala::Facebook::APIError in Homes
Showing /home/daniel/Homes/app/views/shared/_event.html.erb where line
OAuthException: Error validating access token: Session has expired at unix time 1328727600. The current unix time is 1328802133.
Extracted source (around line
16: <img src="../assets/friends-icon.png" alt="User profile apicture" height="33" width="43">
17: <% if current_user %>
18: <% event.friends_in_event(@person).each do |f| %>
19: <%= link_to(image_tag(f.fb_picture, :size => "43x33"), person_path(f.id)) %>
20: <% end %>
21: <% end %>
22: </div>
Authentication works well, but the offline_access option is already outdated on facebook, which works well, but now we have this problem. Is this any way to extend access_token ?, or is there another solution ?.
This is our omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, ENV['FB_KEY'], ENV['FB_SECRET'],
{ :scope => 'email,offline_access,user_photos,publish_stream',
:client_options => { :ssl => { :ca_path => "/etc/ssl/certs" } } }
end
And our koala.rb
Koala.http_service.http_options = {
:ssl => { :ca_path => "/etc/ssl/certs" }
}
Thanks in advance.
source
share