@@ -461,7 +461,16 @@ protected function processUserHint(OAuth2AuthenticationRequest $request, Client
461461 $ token_hint = $ request ->getIdTokenHint ();
462462 $ otp_login_hint = $ request ->getOTPLoginHint ();
463463
464- Log::debug (sprintf ("InteractiveGrant::processUserHint request %s client %s " , $ request ->__toString (), $ client ->getId ()));
464+ Log::debug
465+ (
466+ sprintf
467+ (
468+ "InteractiveGrant::processUserHint request %s client %s " ,
469+ $ request ->__toString (),
470+ $ client ->getId ()
471+ )
472+ );
473+
465474 // process login hint
466475 $ user = null ;
467476 if (!empty ($ otp_login_hint ) && !empty ($ login_hint )
@@ -484,7 +493,7 @@ protected function processUserHint(OAuth2AuthenticationRequest $request, Client
484493 $ user = $ this ->auth_service ->getUserById ($ user_id );
485494 }
486495 $ request ->markParamAsProcessed (OAuth2Protocol::OAuth2Protocol_LoginHint);
487- } else if (!empty ($ token_hint )) {
496+ } else if (!empty ($ token_hint ) && ! $ request -> isProcessedParam (OAuth2Protocol::OAuth2Protocol_IDTokenHint) ) {
488497 Log::debug ("InteractiveGrant::processUserHint processing Token hint... " );
489498
490499 $ jwt = BasicJWTFactory::build ($ token_hint );
@@ -544,6 +553,7 @@ protected function processUserHint(OAuth2AuthenticationRequest $request, Client
544553
545554 $ this ->auth_service ->reloadSession ($ jti ->getValue ());
546555
556+ $ request ->markParamAsProcessed (OAuth2Protocol::OAuth2Protocol_IDTokenHint);
547557 }
548558 if (!is_null ($ user ))
549559 {
@@ -689,6 +699,15 @@ protected function shouldForceReLogin(OAuth2AuthorizationRequest $request, IClie
689699 */
690700 protected function mustAuthenticateUser (OAuth2AuthorizationRequest $ request , Client $ client )
691701 {
702+ Log::debug
703+ (
704+ sprintf
705+ (
706+ "InteractiveGrant::mustAuthenticateUser: request %s client %s " ,
707+ $ request ->__toString (),
708+ $ client ->getClientId ()
709+ )
710+ );
692711
693712 if ($ request instanceof OAuth2AuthenticationRequest) {
694713 try {
@@ -702,19 +721,22 @@ protected function mustAuthenticateUser(OAuth2AuthorizationRequest $request, Cli
702721 throw $ ex ;
703722 }
704723 catch (Exception $ ex ){
705- Log::warning ($ ex );
724+ Log::warning ("InteractiveGrant::mustAuthenticateUser processUserHint generic error " , [ 'error ' => $ ex ]);
725+ $ this ->auth_service ->logout (false );
706726 return true ;
707727 }
708728 }
709729
710730 if ($ this ->shouldPromptLogin ($ request ))
711731 {
732+ Log::warning ("InteractiveGrant::mustAuthenticateUser: shouldPromptLogin " );
712733 $ this ->auth_service ->logout (false );
713734 return true ;
714735 }
715736
716737 if ($ this ->shouldForceReLogin ($ request , $ client ))
717738 {
739+ Log::warning ("InteractiveGrant::mustAuthenticateUser: shouldForceReLogin " );
718740 $ this ->auth_service ->logout (false );
719741 return true ;
720742 }
0 commit comments