diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java index 66197b7faf..dfe6b2f0c5 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java @@ -132,7 +132,7 @@ public class AuthorizationEndpoint { state = params.getFirst(OIDCLoginProtocol.STATE_PARAM); scope = params.getFirst(OIDCLoginProtocol.SCOPE_PARAM); loginHint = params.getFirst(OIDCLoginProtocol.LOGIN_HINT_PARAM); - prompt = params.getFirst(OIDCLoginProtocol.REDIRECT_URI_PARAM); + prompt = params.getFirst(OIDCLoginProtocol.PROMPT_PARAM); idpHint = params.getFirst(AdapterConstants.KC_IDP_HINT); checkSsl(); diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/LoginTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/LoginTest.java index 8c5a2f8b22..e645ca32f7 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/LoginTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/LoginTest.java @@ -50,6 +50,9 @@ import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.core.Response; import java.util.Map; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + /** * @author Stian Thorgersen */ @@ -198,6 +201,25 @@ public class LoginTest { events.expectLogin().user(userId).detail(Details.USERNAME, "login-test").assertEvent(); } + @Test + public void loginPromptNone() { + driver.navigate().to(oauth.getLoginFormUrl().toString() + "&prompt=none"); + + assertFalse(loginPage.isCurrent()); + assertTrue(appPage.isCurrent()); + + loginPage.open(); + loginPage.login("login-test", "password"); + Assert.assertEquals(RequestType.AUTH_RESPONSE, appPage.getRequestType()); + + events.expectLogin().user(userId).detail(Details.USERNAME, "login-test").assertEvent(); + + driver.navigate().to(oauth.getLoginFormUrl().toString() + "&prompt=none"); + Assert.assertEquals(RequestType.AUTH_RESPONSE, appPage.getRequestType()); + + events.expectLogin().user(userId).removeDetail(Details.USERNAME).detail(Details.AUTH_METHOD, "sso").assertEvent(); + } + @Test public void loginNoTimeoutWithLongWait() { try { @@ -264,9 +286,9 @@ public class LoginTest { try { loginPage.open(); - Assert.assertFalse(loginPage.isRememberMeChecked()); + assertFalse(loginPage.isRememberMeChecked()); loginPage.setRememberMe(true); - Assert.assertTrue(loginPage.isRememberMeChecked()); + assertTrue(loginPage.isRememberMeChecked()); loginPage.login("login-test", "password"); Assert.assertEquals(RequestType.AUTH_RESPONSE, appPage.getRequestType()); @@ -282,7 +304,7 @@ public class LoginTest { // Assert rememberMe checked and username/email prefilled loginPage.open(); - Assert.assertTrue(loginPage.isRememberMeChecked()); + assertTrue(loginPage.isRememberMeChecked()); Assert.assertEquals("login-test", loginPage.getUsername()); loginPage.setRememberMe(false);