File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments