Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
fix exception with prompt=login #4572 (#4577)
Browse files Browse the repository at this point in the history
  • Loading branch information
brockallen authored Jun 25, 2020
1 parent 6ca5b25 commit 8a4fb71
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static class ValidatedAuthorizeRequestExtensions
{
public static void RemovePrompt(this ValidatedAuthorizeRequest request)
{
request.PromptModes = null;
request.PromptModes = Enumerable.Empty<string>();
request.Raw.Remove(OidcConstants.AuthorizeRequest.Prompt);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}

0 comments on commit 8a4fb71

Please sign in to comment.