diff --git a/Gemfile b/Gemfile index 06fd1e2a..ef3333dc 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,7 @@ gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2' # See https://github.com/rails/execjs#readme for more supported runtimes -# gem 'therubyracer', platforms: :ruby +gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library gem 'jquery-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 4055c774..8cca8325 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -100,6 +100,7 @@ GEM json (1.8.6) json (1.8.6-java) jwt (1.5.6) + libv8 (3.16.14.19-x86_64-linux) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -214,6 +215,7 @@ GEM rb-fsevent (0.10.2) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) + ref (2.0.0) request_store (1.4.0) rack (>= 1.4) ruby-saml (1.4.3) @@ -252,6 +254,9 @@ GEM sqlite3 (1.3.13-x64-mingw32) sqlite3 (1.3.13-x86-mingw32) sqlite3 (1.3.13-x86-mswin32-60) + therubyracer (0.12.3) + libv8 (~> 3.16.14.15) + ref thor (0.20.0) thread_safe (0.3.6) thread_safe (0.3.6-java) @@ -320,6 +325,7 @@ DEPENDENCIES spring spring-watcher-listen (~> 2.0.0) sqlite3 + therubyracer turbolinks (~> 5) tzinfo-data uglifier (>= 1.3.0) diff --git a/app/assets/images/cas-normal.png b/app/assets/images/cas-normal.png new file mode 100644 index 00000000..dff74ac7 Binary files /dev/null and b/app/assets/images/cas-normal.png differ diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 6a259706..65abc7a6 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -23,10 +23,6 @@ class SessionsController < ApplicationController if Rails.application.config.omniauth_ldap redirect_to "#{relative_root}/auth/ldap" end - #If SAML is enabled, just route to it instead. - if Rails.application.config.omniauth_saml - redirect_to "#{relative_root}/auth/saml" - end end def create diff --git a/app/views/sessions/new.erb b/app/views/sessions/new.erb index 5b5694b4..6cd60243 100644 --- a/app/views/sessions/new.erb +++ b/app/views/sessions/new.erb @@ -49,6 +49,18 @@ <% end %> <% end %> + <% if omniauth_providers_configured(:saml) %> + <%= link_to omniauth_login_url(:saml), class: "signin-link signin-link-google" do %> +
+
+ <%= image_tag("cas-normal.png", alt: "Login with SAML", class: "signin-icon") %> +
+
+ +
+
+ <% end %> + <% end %> <% end %>