66
77use League \OAuth2 \Server \Exception \OAuthServerException ;
88use Psr \Http \Message \ServerRequestInterface ;
9+ use SimpleSAML \Module \oidc \Bridges \SspBridge ;
910use SimpleSAML \Module \oidc \Factories \AuthSimpleFactory ;
1011use SimpleSAML \Module \oidc \Helpers ;
1112use SimpleSAML \Module \oidc \Server \Exceptions \OidcServerException ;
1617use SimpleSAML \Module \oidc \Utils \RequestParamsResolver ;
1718use SimpleSAML \OpenID \Codebooks \HttpMethodsEnum ;
1819use SimpleSAML \OpenID \Codebooks \ParamsEnum ;
19- use SimpleSAML \Utils \HTTP ;
2020
2121class PromptRule extends AbstractRule
2222{
@@ -25,6 +25,7 @@ public function __construct(
2525 Helpers $ helpers ,
2626 private readonly AuthSimpleFactory $ authSimpleFactory ,
2727 private readonly AuthenticationService $ authenticationService ,
28+ private readonly SspBridge $ sspBridge ,
2829 ) {
2930 parent ::__construct ($ requestParamsResolver , $ helpers );
3031 }
@@ -82,9 +83,10 @@ public function checkRule(
8283 if (in_array ('login ' , $ prompt , true ) && $ authSimple ->isAuthenticated ()) {
8384 unset($ requestParams [ParamsEnum::Prompt->value ]);
8485 $ loginParams = [];
85- // TODO mivanci move to SSP Bridge
86- $ loginParams ['ReturnTo ' ] = (new HTTP ())
87- ->addURLParameters ((new HTTP ())->getSelfURLNoQuery (), $ requestParams );
86+ $ loginParams ['ReturnTo ' ] = $ this ->sspBridge ->utils ()->http ()->addURLParameters (
87+ $ this ->sspBridge ->utils ()->http ()->getSelfURLNoQuery (),
88+ $ requestParams ,
89+ );
8890
8991 $ this ->authenticationService ->authenticate ($ client , $ loginParams );
9092 }
0 commit comments