Skip to content

Feature/handling redirect when digiD login is cancelled - #11

Merged
0314R merged 4 commits into
First8:26.5.xfrom
Dpragt:feature/Handling-redirect-when-DigiD-login-is-cancelled
Jul 22, 2026
Merged

Feature/handling redirect when digiD login is cancelled#11
0314R merged 4 commits into
First8:26.5.xfrom
Dpragt:feature/Handling-redirect-when-DigiD-login-is-cancelled

Conversation

@Dpragt

@Dpragt Dpragt commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

#PR Summary

This PR adds configurable error redirect handling to the SAML authentication flow.

New configuration options (disabled by default):

  • customErrorRedirectEnabled: enables custom error redirects
  • errorCallbackPath: redirect path for error/denied cases
  • cancelledCallbackPath: redirect path for cancelled/failed cases

When enabled, a wrapper (ErrorRedirectCallbackWrapper) intercepts error() and cancelled() callbacks and issues a 302 redirect to the configured paths. All other behavior remains unchanged and falls back to the default implementation if needed.

Basic open redirect protections are included (restricted schemes, validated paths, no user-controlled domains).

Feel free to adjust this PR to better align with your company’s standards and conventions.

DPlevel added 2 commits April 13, 2026 14:38
#PR Summary

This PR adds configurable error redirect handling to the SAML authentication flow.

New configuration options (disabled by default):

customErrorRedirectEnabled — enables custom error redirects
errorCallbackPath — redirect path for error/denied cases
cancelledCallbackPath — redirect path for cancelled/failed cases

When enabled, a wrapper (ErrorRedirectCallbackWrapper) intercepts error() and cancelled() callbacks and issues a 302 redirect to the configured paths. All other behavior remains unchanged and falls back to the default implementation if needed.

Basic open redirect protections are included (restricted schemes, validated paths, no user-controlled domains).

Feel free to adjust this PR to better align with your company’s standards and conventions.
@Dpragt Dpragt changed the title Feature/handling redirect when digi d login is cancelled Feature/handling redirect when digiD login is cancelled Jul 1, 2026
@Dpragt

Dpragt commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@0314R #10 #14

Je hebt het probleem gevonden zo te zien...
Is de PR zo 'good to merge'?

@0314R

0314R commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

@Dpragt
Another comment: Four new fields for your config keys would bring too much clutter to the frontend. Our suggestion is to have just two config keys: One for the “cancelled” case, and one for the “error” case, so not two for each (absolute URL and relative path) as it is now.

Having two keys instead of four not only makes the frontend acceptable, but it also would make the backend less cluttered in my opinion.

Not to pressure you (after having made you wait for 3 weeks), but we want to merge the PR before next Wednesday if possible. That is: Before we update the plugin for the next Keycloak versions, which we are quite behind on. Let us know if that is not doable, then I will commit the suggested adjustment myself, if you are also okay with that.

@Dpragt

Dpragt commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@0314R
I will commit the requested adjustments at the end of the day!

@0314R
0314R self-requested a review July 22, 2026 15:02

@0314R 0314R left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd requested changes informally, see Conversation. @Dpragt complied perfectly.

Will be making a different PR myself for the frontend changes.

@0314R
0314R merged commit 65486cf into First8:26.5.x Jul 22, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants