diff --git a/src/IdentityServer4/src/Extensions/ValidatedAuthorizeRequestExtensions.cs b/src/IdentityServer4/src/Extensions/ValidatedAuthorizeRequestExtensions.cs index db07e85ba5..e352f4afd0 100644 --- a/src/IdentityServer4/src/Extensions/ValidatedAuthorizeRequestExtensions.cs +++ b/src/IdentityServer4/src/Extensions/ValidatedAuthorizeRequestExtensions.cs @@ -18,7 +18,7 @@ public static class ValidatedAuthorizeRequestExtensions { public static void RemovePrompt(this ValidatedAuthorizeRequest request) { - request.PromptModes = null; + request.PromptModes = Enumerable.Empty(); request.Raw.Remove(OidcConstants.AuthorizeRequest.Prompt); } diff --git a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/AuthorizeTests.cs b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/AuthorizeTests.cs index 5742ff2487..6baefe155f 100644 --- a/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/AuthorizeTests.cs +++ b/src/IdentityServer4/test/IdentityServer.IntegrationTests/Endpoints/Authorize/AuthorizeTests.cs @@ -1138,5 +1138,26 @@ public async Task code_flow_with_fragment_response_type_should_be_allowed() var response = await _mockPipeline.BrowserClient.GetAsync(url); _mockPipeline.LoginWasCalled.Should().BeTrue(); } + + + [Fact] + [Trait("Category", Category)] + public async Task prompt_login_should_show_login_page() + { + await _mockPipeline.LoginAsync("bob"); + + var url = _mockPipeline.CreateAuthorizeUrl( + clientId: "client3", + responseType: "id_token", + scope: "openid profile", + redirectUri: "https://client3/callback", + state: "123_state", + nonce: "123_nonce", + extra:new { prompt = "login" } + ); + var response = await _mockPipeline.BrowserClient.GetAsync(url); + + _mockPipeline.LoginWasCalled.Should().BeTrue(); + } } }