[GOVCMS-13417] Added env var to allow error URL override. #520
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Currently, when SimpleSAMLphp library encounters an error/rejection in the authentication flow the users get redirected to a generic “Unhandled exception” error page generated by SimpleSAMLphp library. The error might happen due to various reasons, e.g. when a user “Cancels” the authentication from the IdP. Because SimpleSAMLphp operates outside of Drupal, it does not know what to do in that situation, hence the generic error page.
Proposed solution
To improve the UX, there is a ErrorURL setting that can be set in the SP metadata to redirect users to a page that receives errors that may occur during authentication flow. This setting defaults to null as it is now, but optionally could be overwritten via an env variable to allow customers to customise this (e.g. return back to login page with a Drupal message).