Ensure referrer and referrer_uri params are carried over to account-console

Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
This commit is contained in:
Thomas Darimont 2024-10-16 20:39:36 +02:00 committed by Pedro Igor
parent 40bdc902f0
commit f99c5f6df3

View file

@ -214,6 +214,18 @@ public class AccountConsole implements AccountResourceProvider {
if (!StringUtil.isNullOrEmpty(path)) {
consoleUriBuilder.path(path);
}
var queryParameters = session.getContext().getUri().getQueryParameters();
if (!queryParameters.isEmpty()) {
String referrer = queryParameters.getFirst("referrer");
if (referrer != null) {
consoleUriBuilder.queryParam("referrer", referrer);
}
String referrerUri = queryParameters.getFirst("referrer_uri");
if (referrerUri != null) {
consoleUriBuilder.queryParam("referrer_uri", referrerUri);
}
}
URI targetUri = consoleUriBuilder.build(realm.getName());
String pkceChallenge;