Closed simevo closed 6 years ago
Verificare che il codice del file in: /myservice/../templates/selectidp-links.php sia coerente con quello del template in: spid-php/setup/templates/selectidp-links.tpl
In caso contrario l'installazione non è avvenuta correttamente.
Inoltre verificare i permessi sul file selectidp-links.php
$ diff ./setup/templates/selectidp-links.tpl ./vendor/simplesamlphp/simplesamlphp/templates/selectidp-links.php
32,33c32,33
< <link rel="stylesheet" href="/{{SERVICENAME}}/css/agid-spid-enter.css">
< <link rel="icon" type="image/ico" href="/{{SERVICENAME}}/img/favicon.ico">
---
> <link rel="stylesheet" href="/myservice/css/agid-spid-enter.css">
> <link rel="icon" type="image/ico" href="/myservice/img/favicon.ico">
61c61
< <script type="text/javascript" src="/{{SERVICENAME}}/js/agid-spid-enter.js" ></script>
---
> <script type="text/javascript" src="/myservice/js/agid-spid-enter.js" ></script>
sembra OK
verifico che l'utente www-data possa leggere il file selectidp-links.php
:
sudo su - www-data -s /bin/sh -c 'cat /srv/spid-php/vendor/simplesamlphp/simplesamlphp/templates/selectidp-links.php'
e lo può leggere
però trovo questo in vendor/simplesamlphp/simplesamlphp/log/simplesamlphp.log
:
Jun 14 15:03:08 simplesamlphp DEBUG [afccd751b2] Session: 'service-l1' not valid because we are not authenticated.
Jun 14 15:03:10 simplesamlphp DEBUG [afccd751b2] Session: 'service-l1' not valid because we are not authenticated.
Jun 14 15:03:11 simplesamlphp DEBUG [afccd751b2] Session: 'service-l1' not valid because we are not authenticated.
Jun 14 15:03:11 simplesamlphp DEBUG [afccd751b2] Saved state: '_b111a67e0a7547cc9b85d610622b5f518fab9bd9fe:https://spid.simevo.com/myservice/module.php/core/as_login.php?AuthId=service-l1&ReturnTo=https%3A%2F%2Fspid.simevo.com%2F'
Jun 14 15:03:11 simplesamlphp INFO [afccd751b2] idpDisco.saml: Accessing discovery service.
Jun 14 15:03:11 simplesamlphp INFO [afccd751b2] idpDisco.saml: returnIdParam initially set to [idpentityid]
Jun 14 15:03:11 simplesamlphp INFO [afccd751b2] idpDisco.saml: isPassive initially set to [FALSE]
Jun 14 15:03:11 simplesamlphp INFO [afccd751b2] idpDisco.saml: getSelectedIdP() returned null
Jun 14 15:03:11 simplesamlphp DEBUG [afccd751b2] Template: Reading [/srv/spid-php/vendor/simplesamlphp/simplesamlphp/dictionaries/disco]
Jun 14 15:03:11 simplesamlphp ERROR [afccd751b2] SimpleSAML_Error_Exception: Error 1 - Call to undefined method SimpleSAML_XHTML_Template::getTranslator()
Jun 14 15:03:11 simplesamlphp ERROR [afccd751b2] Backtrace:
Jun 14 15:03:11 simplesamlphp ERROR [afccd751b2] 2 /srv/spid-php/vendor/simplesamlphp/simplesamlphp/www/_include.php:84 (SimpleSAML_error_handler)
Jun 14 15:03:11 simplesamlphp ERROR [afccd751b2] 1 /srv/spid-php/vendor/simplesamlphp/simplesamlphp/www/_include.php:52 (SimpleSAML_exception_handler)
Jun 14 15:03:11 simplesamlphp ERROR [afccd751b2] 0 [builtin] (N/A)
cancellando le linee da 3 a 25 di https://github.com/italia/spid-php/blob/master/setup/templates/selectidp-links.tpl#L3 il problema svanisce e appare la pagina di scelta degli IDP
Sembra non trovi il metodo SimpleSAML_XHTML_Template::getTranslator(). Si sono verificati errori durante l'esecuzione di composer install? Il seguente file corrisponde? https://github.com/simplesamlphp/simplesamlphp/blob/master/lib/SimpleSAML/XHTML/Template.php
Ho inserito una stampa di debug in selectidp-links.php
:
echo print_r($this);
e si vede che $this
è un oggetto di tipo SimpleSAML_XHTML_Template
quindi file Template.php
è stato processato.
Leggendo quest'ultimo però ho notato che il metodo getTranslator
non è presente: sembra che si possa chiamare direttamente $this->includeInlineTranslation
, segue PR...
Quale versione di SimpleSAMLphp si sta utilizzando?
Nelle ultime versioni, ed in particolare nell'ultima versione rilasciata (1.15.4) il metodo getTranslator è presente, mentre è deprecato richiamare direttamente includeInLineTranslation
/**
* Wraps Translate->includeInlineTranslation()
*
* @see \SimpleSAML\Locale\Translate::includeInlineTranslation()
* @deprecated This method will be removed in SSP 2.0. Please use
* \SimpleSAML\Locale\Translate::includeInlineTranslation() instead.
*/
public function includeInlineTranslation($tag, $translation)
{
$this->translator->includeInlineTranslation($tag, $translation);
}
Inoltre, la parte di codice che si vorrebbe modificare del file selectidp-links.php con la PR #16 è identica a quella del file originale del repository SimpleSAMLphp:
https://github.com/simplesamlphp/simplesamlphp/blob/simplesamlphp-1.15/templates/selectidp-links.php
location.href
a:https://spid.simevo.com/myservice/module.php/core/as_login.php?AuthId=service-l1&ReturnTo=https%3A%2F%2Fspid.simevo.com
https://spid.simevo.com/myservice/module.php/saml/disco.php?entityID=https%3A%2F%2Fspid.simevo.com&return=https%3A%2F%2Fspid.simevo.com%2Fmyservice%2Fmodule.php%2Fsaml%2Fsp%2Fdiscoresp.php%3FAuthID%3D_c9f63d95f0aa8e19e2485c697629c8ea265725233f%253Ahttps%253A%252F%252Fspid.simevo.com%252Fmyservice%252Fmodule.php%252Fcore%252Fas_login.php%253FAuthId%253Dservice-l1%2526ReturnTo%253Dhttps%25253A%25252F%25252Fspid.simevo.com&returnIDParam=idpentityid
/var/log/nginx/error.log
sul serverche fare ?