KEYCLOAK-11155 split on first '=' instead of all

This commit is contained in:
Erik Jan de Wit 2020-02-20 09:55:35 +01:00 committed by Stian Thorgersen
parent 93a1374558
commit 8297c0c878
2 changed files with 20 additions and 3 deletions

View file

@ -1103,9 +1103,10 @@
oauthParams: {}
}
for (var i = 0; i < p.length; i++) {
var t = p[i].split('=');
if (supportedParams.indexOf(t[0]) !== -1) {
result.oauthParams[t[0]] = t[1];
var split = p[i].indexOf("=");
var key = p[i].slice(0, split);
if (supportedParams.indexOf(key) !== -1) {
result.oauthParams[key] = p[i].slice(split + 1);
} else {
if (result.paramsString !== '') {
result.paramsString += '&';

View file

@ -474,6 +474,22 @@ public class JavascriptAdapterTest extends AbstractJavascriptTest {
});
}
@Test
public void equalsSignInRedirectUrl() {
testAppUrl = authServerContextRootPage.toString().replace("localhost", NIP_IO_URL) + JAVASCRIPT_URL + "/index.html?test=bla=bla&super=man";
jsDriver.navigate().to(testAppUrl);
JSObjectBuilder arguments = defaultArguments();
testExecutor.init(arguments, this::assertInitNotAuth)
.login(this::assertOnLoginPage)
.loginForm(testUser, this::assertOnTestAppUrl)
.init(arguments, (driver1, output1, events2) -> {
assertTrue(driver1.getCurrentUrl().contains("bla=bla"));
assertSuccessfullyLoggedIn(driver1, output1, events2);
});
}
@Test
public void spaceInRealmNameTest() {
// Unfortunately this test doesn't work on phantomjs