Skip to content

Commit 91b43be

Browse files
committed
Merge pull request #2473 from phusl/CA-185733
CA-185733: RPU XenCenter stuck on upgrade screen if connected as XS Pool Admin
2 parents 14fd913 + 4fa13a7 commit 91b43be

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

ocaml/xapi/xapi_session.ml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,22 @@ let login_with_password ~__context ~uname ~pwd ~version ~originator = wipe_param
415415
debug "Failed to locally authenticate user %s from %s: %s" uname (Context.get_origin __context) msg;
416416

417417
(* 2. then against the external auth service *)
418-
419-
(* 2.1. we first authenticate the user using the external authentication plugin *)
418+
(* 2.1. we first check the external auth service status *)
419+
let rec waiting_event_hook_auth_on_xapi_initialize_succeeded seconds =
420+
if not !Xapi_globs.event_hook_auth_on_xapi_initialize_succeeded then
421+
begin
422+
if seconds <= 0 then
423+
let msg = (Printf.sprintf "External authentication %s service still initializing" auth_type) in
424+
error "%s" msg;
425+
thread_delay_and_raise_error uname msg ~error:Api_errors.session_invalid
426+
else
427+
debug "External authentication %s service initializing..." auth_type;
428+
Thread.delay 1.0;
429+
waiting_event_hook_auth_on_xapi_initialize_succeeded (seconds-1);
430+
end
431+
in
432+
waiting_event_hook_auth_on_xapi_initialize_succeeded 120;
433+
(* 2.2. we then authenticate the usee using the external authentication plugin *)
420434
(* so that we know that he/she exists there *)
421435
let subject_identifier = (try
422436
begin

0 commit comments

Comments
 (0)