<div dir="ltr"><div>In case anyone is interested...</div><div><br></div><div>We wanted to have Arvados use the authentication information provided by the web server.  This is due to the fact that we already have setup a single-sign-on system for our webservers and wanted Arvados integrate with the existing infrastructure.  </div><div><br></div><div>We made the changes to the user_sessions_controller.rb for the API service, see following patch.  Then setup the web server to authenticate users accessing the path "/login" for the API server.  </div><div><br></div><div>For example, we use Shibboleth and added the following configuration to our web server.<br></div><div><br></div><div><Location /login ><br></div><div><div><div>  AuthType shibboleth</div><div>  ShibCompatWith24 On</div><div>  ShibRequestSetting requireSession 1</div><div>  require shib-session</div></div><div></Location></div></div><div><br></div><div>Then made sure that shibboleth provided the "eppn", which is equivalent to an email address, as the REMOTE_USER parameter.  The following is a snippet from our shibboleth2.xml file.</div><div><br></div><div><ApplicationDefaults entityID="..." REMOTE_USER="eppn uid"><br></div><div><br></div><div>Restarted the shibd and webserver and now the webserver will authenticate users and then Arvados will use the user ID to authorize the user.  We are not allowing registration for Arvados so, we just manually add users from the workbench...at least for now.</div><div><br></div><div>--- a/services/api/app/<wbr>controllers/user_sessions_<wbr>controller.rb<br></div><div><div>+++ b/services/api/app/<wbr>controllers/user_sessions_<wbr>controller.rb</div><div>@@ -100,6 +100,15 @@</div><div>   # to save the return_to parameter (if it exists; see the application</div><div>   # controller). /auth/joshid bypasses the application controller.</div><div>   def login</div><div>+    </div><div>+    # Added to allow Arvados to use user ID from web server.  </div><div>+    # This assumes that the user ID is the email address of the user.</div><div>+    if request.env["REMOTE_USER"] then</div><div>+      logger.warn "Using REMOTE_USER from webserver"</div><div>+      current_user = User.find_by_email(request.<wbr>env["REMOTE_USER"])</div><div>+      Thread.current[:user] = current_user</div><div>+    end</div><div>+</div><div>     auth_provider = if params[:auth_provider] then "auth_provider=#{CGI.escape(<wbr>params[:auth_provider])}" else "" end</div><div> </div><div>     if current_user and params[:return_to]</div><div>@@ -111,9 +120,9 @@</div><div> </div><div>       send_api_token_to(params[:<wbr>return_to], current_user)</div><div>     elsif params[:return_to]</div><div>-      redirect_to "/auth/joshid?return_to=#{CGI.<wbr>escape(params[:return_to])}&#{<wbr>auth_provider}"</div><div>+      redirect_to "#{root_path}auth/joshid?<wbr>return_to=#{CGI.escape(params[<wbr>:return_to])}&#{auth_provider}<wbr>"</div><div>     else</div><div>-      redirect_to "/auth/joshid?#{auth_provider}<wbr>"</div><div>+      redirect_to "#{root_path}auth/joshid?#{<wbr>auth_provider}"</div><div>     end</div><div>   end</div><div> </div></div><div><br></div><div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr">George Chlipala, Ph.D.<div><div>Senior Research Specialist</div><div>Research Resources Center</div><div>University of Illinois at Chicago</div></div><div><br></div><div>phone: <a href="tel:312-413-1700" value="+13124131700" target="_blank">312-413-1700</a></div><div>email: <a href="mailto:gchlip2@uic.edu" target="_blank">gchlip2@uic.edu</a></div></div></div></div></div></div></div></div></div></div></div>
</div>