开发者

Sessions in Sinatra using Facebook authentication

开发者 https://www.devze.com 2023-03-15 08:54 出处:网络
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 s

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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消