README.markdown in authlogic-connect-0.0.1 vs README.markdown in authlogic-connect-0.0.2

- old
+ new

@@ -79,13 +79,45 @@ User.all(:conditions => "#{field} is NULL").each { |user| user.update_attribute(field, "") if user.send(field).nil? } change_column :users, field, :string, :default => "", :null => false end end end - -### 4. Make sure you save your objects properly + +### 4. Configure your keys +In `config/initializers/authlogic_connect_config.rb`, write your keys and secrets for each service you would like to support. You have to manually go to the websites and register with the service provider (list of those links coming soon, in token classes for now). + + AuthlogicConnect.config = { + :services => { + :twitter => { + :key => "my_key", + :secret => "my_secret", + :label => "Twitter" + }, + :facebook => { + :key => "my_key", + :secret => "my_secret", + :label => "Facebook" + }, + :google => { + :key => "my_key", + :secret => "my_secret", + :label => "Google" + }, + :yahoo => { + :key => "my_key", + :secret => "my_secret", + :label => "Yahoo" + }, + :vimeo => { + + } + } + } + +### 5. Make sure you save your objects properly + Because of the redirects involved in Oauth and OpenID, you MUST pass a block to the `save` method in your UsersController and UserSessionsController: @user_session.save do |result| if result flash[:notice] # "Login successful!" @@ -97,11 +129,11 @@ You should save your `@user` objects this way as well, because you also want the user to authenticate with OAuth. If we don't use the block, we will get a DoubleRender error. This lets us skip that entire block and send the user along their way without any problems. -### 5. Create Custom Tokens (if they don't already exist) +### 6. Create Custom Tokens (if they don't already exist) Here's an example of the FacebookToken for Oauth class FacebookToken < OauthToken @@ -140,6 +172,11 @@ - Save user - Finish block, render page ## Tests -This has no tests! I had to build this in a weekend and am not fluent with Shoulda, which I'd like to use. One of these days when I can breathe. +This has no tests! I had to build this in a weekend and am not fluent with Shoulda, which I'd like to use. One of these days when I can breathe. + +## TODO + +- Change `register_with_oauth` and related to `register_method` and `login_method`: oauth, openid, traditional +- Build view helpers \ No newline at end of file