File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -613,6 +613,7 @@ public function saml_login() {
613613
614614 // We store the IdP in the session to generate the config/config.php array with the default local SP.
615615 $ idpalias = optional_param ('idpalias ' , '' , PARAM_TEXT );
616+ $ idp = optional_param ('idp ' , '' , PARAM_TEXT );
616617 if (!empty ($ idpalias )) {
617618 $ idpfound = false ;
618619
@@ -627,8 +628,11 @@ public function saml_login() {
627628 if (!$ idpfound ) {
628629 $ this ->error_page (get_string ('noidpfound ' , 'auth_saml2 ' , $ idpalias ));
629630 }
630- } else if (isset ($ _GET ['idp ' ])) {
631- $ SESSION ->saml2idp = $ _GET ['idp ' ];
631+ } else if (!empty ($ idp )) {
632+ if (array_key_exists ($ idp , $ this ->metadataentities )) {
633+ $ idpentity = $ this ->metadataentities [$ idp ];
634+ $ SESSION ->saml2idp = $ idpentity ->md5entityid ;
635+ }
632636 } else if (!is_null ($ this ->defaultidp )) {
633637 $ SESSION ->saml2idp = $ this ->defaultidp ->md5entityid ;
634638 } else if ($ this ->multiidp ) {
You can’t perform that action at this time.
0 commit comments