Skip to content

Pks/devise google oauth2#3

Open
ninjapanzer wants to merge 2 commits intonurelm:masterfrom
ninjapanzer:pks/devise_google_oauth2
Open

Pks/devise google oauth2#3
ninjapanzer wants to merge 2 commits intonurelm:masterfrom
ninjapanzer:pks/devise_google_oauth2

Conversation

@ninjapanzer
Copy link
Contributor

What we have here is an integration of devise with oauth for google

I know this PR is big but it is mostly devise boiler plate

The heavy work is in:

  • controllers/users/omniauth_callback_controller.rb
  • models/user.rb

Overview

  • Devise provides login services
  • Oauth acts as middleware to allow login through an external service like google
  • I figure this is a good idea due to NuRelm's google apps usage
  • Additionally a new role / model can be defined with devise to allow user(clents) to see specific application uptime

Some things came along for the ride

  • 2 new gems
  • an update to the nav_link helper allowing passthrough of the link_for options hash
  • user model

What you need to test

  1. Google Client Keys - Checkout .google_oauth2_env for some instructions

  2. New Models

    rake db:migrate

  3. An admin user - you can run rake db:seed to populate a default

    user: admin@serverfu.com
    pass: password

  4. run

    rails s

  5. Check it out in your browser.

    There are a two types of signin. The normal user/pass and Sing in with google which will redirect you to the google login screen

turned off open registration in the user.rb model
By default the side registration is disabled but this is connected to the devise registerable flag set on the user model currently remarked out
@ninjapanzer ninjapanzer mentioned this pull request Feb 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant