Custom Error Message for Auth Module

95 views
Skip to first unread message

Rubén Cheng

unread,
Sep 28, 2023, 2:42:28 PM9/28/23
to SimpleSAMLphp
Hi all,

I have a custom module for authentication for SimpleSAMLphp 1.9.x. that is working which displays some custom error messages using dictionary json files based on some autentication operations.

I was trying to migrate the module to SimpleSAMLphp 2.0 but I have issues to display these custom error. I read that I have to use .po files and locale directories, but I tried without success. The module written was based on the ldap module.

I tried using a tag both  \SimpleSaml\Error\Error(""<module>:<dictionary>:<tag>") and \SimpleSaml\Error\Error(""TEST_TAG") without success.

Does anyone know what I need to do to migrate and get this working again?

Following is the trace
==============================================
SimpleSAML\Error\Error: UNHANDLEDEXCEPTION
Backtrace: 2 public/_include.php:28 (SimpleSAML_exception_handler) 1 vendor/symfony/error-handler/ErrorHandler.php:607 (Symfony\Component\ErrorHandler\ErrorHandler::handleException) 0 [builtin] (N/A) Caused by: SimpleSAML\Error\Exception: Key "TEST_TAG" for array with keys "ACSPARAMS, ARSPARAMS, AUTHSOURCEERROR, BADREQUEST, CASERROR, CONFIG, CREATEREQUEST, DISCOPARAMS, GENERATEAUTHNRESPONSE, INVALIDCERT, LDAPERROR, LOGOUTINFOLOST, LOGOUTREQUEST, MEMCACHEDOWN, METADATA, METADATANOTFOUND, NOACCESS, NOCERT, NORELAYSTATE, NOSTATE, NOTFOUND, NOTFOUNDREASON, NOTSET, NOTVALIDCERT, PROCESSASSERTION, PROCESSAUTHNREQUEST, RESPONSESTATUSNOSUCCESS, SLOSERVICEPARAMS, SSOPARAMS, UNHANDLEDEXCEPTION, UNKNOWNCERT, USERABORTED, WRONGUSERPASS" does not exist in core:loginuserpass.twig Backtrace: 2 src/SimpleSAML/XHTML/Template.php:562 (SimpleSAML\XHTML\Template::getContents) 1 src/SimpleSAML/XHTML/Template.php:577 (SimpleSAML\XHTML\Template::send) 0 public/module.php:24 (N/A) Caused by: Twig\Error\RuntimeError: Key "TEST_TAG" for array with keys "ACSPARAMS, ARSPARAMS, AUTHSOURCEERROR, BADREQUEST, CASERROR, CONFIG, CREATEREQUEST, DISCOPARAMS, GENERATEAUTHNRESPONSE, INVALIDCERT, LDAPERROR, LOGOUTINFOLOST, LOGOUTREQUEST, MEMCACHEDOWN, METADATA, METADATANOTFOUND, NOACCESS, NOCERT, NORELAYSTATE, NOSTATE, NOTFOUND, NOTFOUNDREASON, NOTSET, NOTVALIDCERT, PROCESSASSERTION, PROCESSAUTHNREQUEST, RESPONSESTATUSNOSUCCESS, SLOSERVICEPARAMS, SSOPARAMS, UNHANDLEDEXCEPTION, UNKNOWNCERT, USERABORTED, WRONGUSERPASS" does not exist. Backtrace: 19 modules/core/templates/loginuserpass.twig:22 (twig_get_attribute) 18 vendor/twig/twig/src/Environment.php(361) : eval()'d code:88 (__TwigTemplate_386f0a9ae42e1972d050fee9b29efb0c4426b293a60c3b9d84a97fdd3e625199::block_content) 17 vendor/twig/twig/src/Template.php:171 (Twig\Template::displayBlock) 16 vendor/twig/twig/src/Environment.php(361) : eval()'d code:57 (__TwigTemplate_466e4ab54561ad48a1ce0dc92ebfb65f92c891f4054fc8c479ab809cb60f7c85::block_contentwrapper) 15 vendor/twig/twig/src/Template.php:171 (Twig\Template::displayBlock) 14 vendor/twig/twig/src/Environment.php(361) : eval()'d code:96 (__TwigTemplate_25197aa858b30e194d182538f149031d72a1c05a0e7029eeae29b800ee118d8b::doDisplay) 13 vendor/twig/twig/src/Template.php:394 (Twig\Template::displayWithErrorHandling) 12 vendor/twig/twig/src/Template.php:367 (Twig\Template::display) 11 vendor/twig/twig/src/Environment.php(361) : eval()'d code:42 (__TwigTemplate_466e4ab54561ad48a1ce0dc92ebfb65f92c891f4054fc8c479ab809cb60f7c85::doDisplay) 10 vendor/twig/twig/src/Template.php:394 (Twig\Template::displayWithErrorHandling) 9 vendor/twig/twig/src/Template.php:367 (Twig\Template::display) 8 vendor/twig/twig/src/Environment.php(361) : eval()'d code:46 (__TwigTemplate_386f0a9ae42e1972d050fee9b29efb0c4426b293a60c3b9d84a97fdd3e625199::doDisplay) 7 vendor/twig/twig/src/Template.php:394 (Twig\Template::displayWithErrorHandling) 6 vendor/twig/twig/src/Template.php:367 (Twig\Template::display) 5 vendor/twig/twig/src/Template.php:379 (Twig\Template::render) 4 vendor/twig/twig/src/TemplateWrapper.php:40 (Twig\TemplateWrapper::render) 3 vendor/twig/twig/src/Environment.php:280 (Twig\Environment::render) 2 src/SimpleSAML/XHTML/Template.php:560 (SimpleSAML\XHTML\Template::getContents) 1 src/SimpleSAML/XHTML/Template.php:577 (SimpleSAML\XHTML\Template::send) 0 public/module.php:24 (N/A)
=========================================             
Reply all
Reply to author
Forward
0 new messages