# SPDX-License-Identifier: AGPL-3.0
class UserSessionsController < ApplicationController
- before_filter :require_auth_scope, :only => [ :destroy ]
+ before_action :require_auth_scope, :only => [ :destroy ]
- skip_before_filter :set_cors_headers
- skip_before_filter :find_object_by_uuid
- skip_before_filter :render_404_if_no_object
+ skip_before_action :set_cors_headers
+ skip_before_action :find_object_by_uuid
+ skip_before_action :render_404_if_no_object
respond_to :html
# omniauth callback method
def create
- omniauth = env['omniauth.auth']
+ omniauth = request.env['omniauth.auth']
identity_url_ok = (omniauth['info']['identity_url'].length > 0) rescue false
unless identity_url_ok
:first_name => omniauth['info']['first_name'],
:last_name => omniauth['info']['last_name'],
:identity_url => omniauth['info']['identity_url'],
- :is_active => Rails.configuration.new_users_are_active,
+ :is_active => Rails.configuration.Users.NewUsersAreActive,
:owner_uuid => system_user_uuid)
if omniauth['info']['username']
user.set_initial_username(requested: omniauth['info']['username'])
# For the benefit of functional and integration tests:
@user = user
+ if user.uuid[0..4] != Rails.configuration.ClusterID
+ # Actually a remote user
+ # Send them to their home cluster's login
+ rh = Rails.configuration.RemoteClusters[user.uuid[0..4]]
+ remote, return_to_url = params[:return_to].split(',', 2)
+ @remotehomeurl = "#{rh.Scheme || "https"}://#{rh.Host}/login?remote=#{Rails.configuration.ClusterID}&return_to=#{return_to_url}"
+ render
+ return
+ end
+
# prevent ArvadosModel#before_create and _update from throwing
# "unauthorized":
Thread.current[:user] = user
flash[:notice] = 'You have logged off'
return_to = params[:return_to] || root_url
- redirect_to "#{Rails.configuration.sso_provider_url}/users/sign_out?redirect_uri=#{CGI.escape return_to}"
+ redirect_to "#{Rails.configuration.Services.SSO.ExternalURL}/users/sign_out?redirect_uri=#{CGI.escape return_to}"
end
# login - Just bounce to /auth/joshid. The only purpose of this function is