[ARVADOS] updated: c70fde67e6f6937dd63889da4df185003ce44e60
git at public.curoverse.com
git at public.curoverse.com
Fri Nov 21 10:49:15 EST 2014
Summary of changes:
apps/workbench/app/views/users/welcome.html.erb | 10 ++++++++--
services/api/app/controllers/user_sessions_controller.rb | 7 ++++---
services/api/lib/josh_id.rb | 2 +-
3 files changed, 13 insertions(+), 6 deletions(-)
via c70fde67e6f6937dd63889da4df185003ce44e60 (commit)
from c4bf3c349264a785a342ad560c6f71792c66b4f8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit c70fde67e6f6937dd63889da4df185003ce44e60
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Fri Nov 21 10:49:52 2014 -0500
4570: Rename 'auth_method' parameter to 'auth_provider' to get the terminology right.
diff --git a/apps/workbench/app/views/users/welcome.html.erb b/apps/workbench/app/views/users/welcome.html.erb
index 53b2ab8..4541d5b 100644
--- a/apps/workbench/app/views/users/welcome.html.erb
+++ b/apps/workbench/app/views/users/welcome.html.erb
@@ -32,8 +32,14 @@
<%= form_tag(arvados_api_client.arvados_login_url(), :method => :get, :authenticity_token => false) do %>
<%= hidden_field_tag 'return_to', request.url %>
<div class="row pull-right">
- <%= select_tag "auth_method", "<option value='google'>Google OpenID</option><option value='google_oauth2'>Google OAuth2</option>".html_safe, class: "form-control", style: "width: 15em; display: inline" %>
- <%= button_tag class: "btn btn-primary" do %>
+
+ <%# Todo: add list of external authentications providers to
+ discovery document, then generate the option list on the fly. Right
+ now, don't provide 'auth_provider' and hope that the default one is
+ the one we want. %>
+
+ <%#= select_tag "auth_provider", "<option value='google'>Google OpenID</option><option value='google_oauth2'>Google OAuth2</option>".html_safe, class: "form-control", style: "width: 15em; display: inline" %>
+ <%= button_tag type: 'submit', name: nil, class: "btn btn-primary" do %>
Log in to <%= Rails.configuration.site_name %> <i class="fa fa-fw fa-arrow-circle-right"></i>
<% end %>
</div>
diff --git a/services/api/app/controllers/user_sessions_controller.rb b/services/api/app/controllers/user_sessions_controller.rb
index 3a5be1c..30ef63f 100644
--- a/services/api/app/controllers/user_sessions_controller.rb
+++ b/services/api/app/controllers/user_sessions_controller.rb
@@ -99,7 +99,8 @@ class UserSessionsController < ApplicationController
# to save the return_to parameter (if it exists; see the application
# controller). /auth/joshid bypasses the application controller.
def login
- auth_method = params[:auth_method] || "google"
+ auth_provider = if params[:auth_provider] then "auth_provider=#{CGI.escape(params[:auth_provider])}" else "" end
+
if current_user and params[:return_to]
# Already logged in; just need to send a token to the requesting
# API client.
@@ -109,9 +110,9 @@ class UserSessionsController < ApplicationController
send_api_token_to(params[:return_to], current_user)
elsif params[:return_to]
- redirect_to "/auth/joshid?return_to=#{CGI.escape(params[:return_to])}&auth_method=#{CGI.escape(auth_method)}"
+ redirect_to "/auth/joshid?return_to=#{CGI.escape(params[:return_to])}&#{auth_provider}"
else
- redirect_to "/auth/joshid?auth_method=#{CGI.escape(auth_method)}"
+ redirect_to "/auth/joshid?#{auth_provider}"
end
end
diff --git a/services/api/lib/josh_id.rb b/services/api/lib/josh_id.rb
index c0efb51..a63b251 100644
--- a/services/api/lib/josh_id.rb
+++ b/services/api/lib/josh_id.rb
@@ -27,7 +27,7 @@ module OmniAuth
end
def authorize_params
- options.authorize_params[:auth_method] = request.params['auth_method']
+ options.authorize_params[:auth_provider] = request.params['auth_provider']
super
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list