Improve error message when required attributes are missing

Open
#430 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
php, symfony

Research direction

Start with src/Surfnet/StepupSelfService/SelfServiceBundle/Security/Authentication/Provider/SamlProvider.php at line 122 and trace how MissingRequiredAttributeException reaches the user-facing error. Inspect the Symfony exception-handling path shown in the log. Done means the missing attribute information is presented to the user instead of only “Something went wrong; please try again.”

Written by the indexing model from the issue text.

Description

error-messaging Imported improve error messages low-prio self service

This issue is imported from pivotal - Originaly created at Apr 9, 2020 by Peter Havekes

The log shows:

messages:Apr  8 13:57:53 sa-test-app.surfconext.nl stepup-selfservice[119612]: {"channel":"app","level":"ERROR","message":"Uncaught PHP Exception Symfony\\Component\\HttpKernel\\Exception\\HttpException: \"Missing value for required attribute \"commonName\"\" at /opt/stepup/Stepup-SelfService-3.1.0-20200123094957Z-899924d0139418958a9e502aa52eeea34494053d/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php line 190","context":{"exception":{"class":"Symfony\\Component\\HttpKernel\\Exception\\HttpException","message":"Missing value for required attribute \"commonName\"","code":0,"file":"/opt/stepup/Stepup-SelfService-3.1.0-20200123094957Z-899924d0139418958a9e502aa52eeea34494053d/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php:190","previous":{"class":"Surfnet\\StepupSelfService\\SelfServiceBundle\\Exception\\MissingRequiredAttributeException","message":"Missing value for required attribute \"commonName\"","code":0,"file":"/opt/stepup/Stepup-SelfService-3.1.0-20200123094957Z-899924d0139418958a9e502aa52eeea34494053d/src/Surfnet/StepupSelfService/SelfServiceBundle/Security/Authentication/Provider/SamlProvider.php:122"}}},"extra":{"art":"32881","server":"sa.test.surfconext.nl","application":"self-service","request_id":"aa25f6bba864e2cfb7a9471687a2fea2"}}

But the user sees "Something went wrong; please try again" (see screenshot).
The user should be informed about the missing information.

Dominant language
PHP
Stars
2
Forks
5
Avg merge
8d 4h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenConext/Stepup-SelfService

All issues in OpenConext/Stepup-SelfService

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.