Skip to content

Commit 357be6c

Browse files
committed
Document the redirect query parameter of the reset endpoint
# Why is this change needed? Prior to this change, the redirect query parameter, the allowed redirect hosts and the wayfReset result parameter of /reset-remember-wayf were only described in parameters.yml.dist. Operators need to know about the open redirect protection and integrators about the result parameter. # How does it address the issue? This change extends the reset section in docs/wayf_remember_choice.md and adds an entry to the CHANGELOG.
1 parent 9f4f29c commit 357be6c

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ Features:
2626
* Added the endpoint `/reset-remember-wayf`, which removes the per-SP `rememberedidps` cookie and redirects to the URL
2727
configured in `wayf.reset_choice_per_idp_redirect`. This new parameter must not be empty. See
2828
`docs/wayf_remember_choice.md`.
29+
* The `/reset-remember-wayf` endpoint accepts a `redirect` query parameter. Only hosts listed in the new parameter
30+
`wayf.reset_choice_allowed_redirect_hosts` are accepted, other values fall back to
31+
`wayf.reset_choice_per_idp_redirect`. The endpoint also appends `wayfReset=removed` or `wayfReset=none` to the
32+
redirect URL.
2933

3034
## 7.2.1
3135

‎docs/wayf_remember_choice.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ The endpoint removes the `rememberedidps` cookie and redirects the user (HTTP 30
105105
The endpoint only accepts `GET` requests and needs no authentication, because it only clears a cookie in the user's own
106106
browser. It does nothing when the cookie is not present. The `rememberchoice` cookie of the global mode is not touched.
107107

108+
The caller can choose where the user lands with the `redirect` query parameter, for example
109+
`/reset-remember-wayf?redirect=https://profile.dev.openconext.local/my-choices`. To prevent an open redirect, the
110+
`redirect` value is only used when it is an absolute `http` or `https` URL whose host is listed in:
111+
112+
# Hosts that may be used in the redirect query parameter
113+
wayf.reset_choice_allowed_redirect_hosts:
114+
- profile.dev.openconext.local
115+
116+
A missing, malformed or unlisted `redirect` falls back to `wayf.reset_choice_per_idp_redirect`. The value in `parameters.yml.dist` is the local
117+
development host. Replace it with the hosts of your own deployment.
118+
119+
The endpoint appends the query parameter `wayfReset` to the final URL, before any fragment. Its value is `removed` when
120+
a cookie was removed and `none` when there was nothing to remove, so the target page can show a matching message.
121+
108122
## Switching modes
109123

110124
Cookies written in one mode are not read in the other. After switching, users have to make their choice once more.

0 commit comments

Comments
 (0)