Sessions in Sinatra using Facebook authentication

一个人想着一个人 提交于 2019-12-12 09:13:37

问题


I'm very new to ruby & Sinatra and I have a basic question:

The app I'm trying to build will use Facebook as it's sole method of authenticating users into the app. I want to store a local users table which will contain only the facebook uid along with some user preferences. I have looked at a couple of gems which allow me to authenticate against the facebook API, however I am unsure how to control sessions within my application once I have established the user is valid. I have been using the koala gem for talking to facebook, and I have also seen the sinatra-session gem for running the session side of things.

Can someone point me in the right direction as to how I can manage my sessions once a user has logged in using their facebook account?


回答1:


I wrote an example sinatra app with this functionality and used the built-in sessions from sinatra. look here, maybe this helps you: https://github.com/benben/simple-ruby-facebook-example



来源:https://stackoverflow.com/questions/6453797/sessions-in-sinatra-using-facebook-authentication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!