Permalink
Browse files

Google Apps added.

  • Loading branch information...
1 parent a7f166f commit 448b6ea3667fcc8f5da509853924b61fc6d611ff @yorch yorch committed Jun 24, 2012
View
@@ -6,6 +6,7 @@ gem 'omniauth-facebook'
gem 'omniauth-github'
gem 'omniauth-twitter'
gem 'omniauth-openid'
+gem 'omniauth-google-apps'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
View
@@ -71,6 +71,10 @@ GEM
omniauth-github (1.0.1)
omniauth (~> 1.0)
omniauth-oauth2 (~> 1.0)
+ omniauth-google-apps (0.0.2)
+ omniauth (~> 1.0)
+ omniauth-openid (~> 1.0)
+ ruby-openid-apps-discovery (~> 1.2.0)
omniauth-oauth (1.0.1)
oauth
omniauth (~> 1.0)
@@ -113,6 +117,8 @@ GEM
rdoc (3.12)
json (~> 1.4)
ruby-openid (2.1.8)
+ ruby-openid-apps-discovery (1.2.0)
+ ruby-openid (>= 2.1.7)
sass (3.1.19)
sass-rails (3.2.5)
railties (~> 3.2.0)
@@ -142,6 +148,7 @@ DEPENDENCIES
omniauth
omniauth-facebook
omniauth-github
+ omniauth-google-apps
omniauth-openid
omniauth-twitter
rails (= 3.2.6)
@@ -88,7 +88,7 @@ def create
omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''
omniauth['extra']['raw_info']['id'] ? @authhash[:uid] = omniauth['extra']['raw_info']['id'].to_s : @authhash[:uid] = ''
omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''
- elsif ['google', 'yahoo', 'twitter', 'myopenid', 'open_id'].index(service_route) != nil
+ elsif ['google', 'google_apps', 'yahoo', 'twitter', 'myopenid', 'open_id'].index(service_route) != nil
omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = ''
omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''
omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''
@@ -1,6 +1,7 @@
<ul id="services_list">
<li><%= link_to "/auth/facebook" do %><%= image_tag "facebook_64.png", :size => "64x64", :alt => "Facebook" %>Facebook<% end %></li>
<li><%= link_to "/auth/google" do %><%= image_tag "google_64.png", :size => "64x64", :alt => "Google" %>Google<% end %></li>
+ <li><%= link_to "/auth/google_apps" do %><%= image_tag "google_64.png", :size => "64x64", :alt => "Google Apps" %>Google Apps<% end %></li>
<li><%= link_to "/auth/yahoo" do %><%= image_tag "yahoo_64.png", :size => "64x64", :alt => "Yahoo" %>Yahoo<% end %></li>
<li><%= link_to "/auth/twitter" do %><%= image_tag "twitter_64.png", :size => "64x64", :alt => "Twitter" %>Twitter<% end %></li>
<li><%= link_to "/auth/github" do %><%= image_tag "github_64.png", :size => "64x64", :alt => "Github" %>Github<% end %></li>
@@ -55,7 +55,7 @@
# dedicated openid
provider :openid, :store => OpenID::Store::Filesystem.new('/tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
- # provider :google_apps, :store => OpenID::Store::Filesystem.new('./tmp'), :name => 'google_apps'
+ provider :google_apps, :store => OpenID::Store::Filesystem.new('/tmp'), :name => 'google_apps'
# /auth/google_apps; you can bypass the prompt for the domain with /auth/google_apps?domain=somedomain.com
provider :openid, :store => OpenID::Store::Filesystem.new('/tmp'), :name => 'yahoo', :identifier => 'yahoo.com'

0 comments on commit 448b6ea

Please sign in to comment.