-
Notifications
You must be signed in to change notification settings - Fork 14
feat: improved prompt handling #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
patchandthat
merged 28 commits into
RockSolidKnowledge:release/3.0.0
from
equist:feat/improved-prompt-handling
Sep 9, 2026
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
7cadb10
Corrected prompt_login_should_show_login_page test and added the same…
equist 5233bb9
Added test for loging in and returning for both prompt and max_age.
equist 38016a6
Added failing tests for letting the login page know prompt/max_age va…
equist 6e3eac5
Removing the prompt/max_age parameters from callback endpoint, but ke…
equist 52caf18
prompt=create is only allowed by itself.
equist 4ee3f60
Test for combining prompt=create with any additional value.
equist 4993d47
Added support for prompt=create
equist 21a2a54
Failing on unsupported prompt modes.
equist 956ac6f
Added missing copyright
equist 98db167
Changed failing unit test to now ensure that prompt values are kept.
equist 4b68a5f
Fixed copy/paste name error of test.
equist d81e021
Add failing test for when prompt parameter is passed in a request obj…
equist aaa9280
Changed strategy for handling that prompt and/or max_age have been pr…
equist a10f6da
Moved constants from root to asub class.
equist 9b92b8c
Added documentation of options.
equist 371061f
Added unit tests for CreateAccountPageResult
equist ae7257b
Added cancellation token to remove warning.
equist 9d3d9fd
Added cancellation token to resolve warning.
equist ba10a1e
Added unit test to ensure that AuthorizeEndpointBase handles IsCreate…
equist e133ee9
Added AuthorizeInteractionResponseGenerator tests for prompt=Create
equist 35e23e4
Added missing copyright.
equist 31260a7
Added unit tests for IdentityServerApplicationBuilderExtensions
equist 8d025e6
Moved two validation tests from integration tests to unit tests.
equist 599cef1
Added unit tests for processed prompt/max_age.
equist 6a71bc7
fix: max_age is kept, except for when it 0 and we're in the callback
equist 44cee7b
feat: Added ProcessedPromptModes property used in callback endpoint.
equist c7dca56
test: Added test for max_age > 0 and processed prompt modes.
equist 224c977
docs: Updated docs about SupportedPromptModes.
equist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
JoStevensRSK marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/Open.IdentityServer/src/Endpoints/Results/CreateAccountPageResult.cs
|
equist marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // Copyright (c) Rock Solid Knowledge Ltd. All rights reserved. | ||
| // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. | ||
|
|
||
|
|
||
| using System.Threading.Tasks; | ||
| using Open.IdentityServer.Validation; | ||
| using Open.IdentityServer.Extensions; | ||
| using Open.IdentityServer.Configuration; | ||
| using Open.IdentityServer.Stores; | ||
| using Microsoft.AspNetCore.Http; | ||
|
|
||
| namespace Open.IdentityServer.Endpoints.Results; | ||
|
|
||
| /// <summary> | ||
| /// Result for login page | ||
| /// </summary> | ||
| /// <seealso cref="Open.IdentityServer.Endpoints.Results.ReturnUrlResult" /> | ||
| public class CreateAccountPageResult : ReturnUrlResult | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="CreateAccountPageResult"/> class. | ||
| /// </summary> | ||
| /// <param name="request">The request.</param> | ||
| /// <exception cref="System.ArgumentNullException">request</exception> | ||
| public CreateAccountPageResult(ValidatedAuthorizeRequest request): | ||
| base(request) { } | ||
|
|
||
| internal CreateAccountPageResult( | ||
| ValidatedAuthorizeRequest request, | ||
| IdentityServerOptions options, | ||
| IAuthorizationParametersMessageStore authorizationParametersMessageStore = null): | ||
| base(request, options, authorizationParametersMessageStore) { } | ||
|
|
||
| /// <summary> | ||
| /// Executes the result. | ||
| /// </summary> | ||
| /// <param name="context">The HTTP context.</param> | ||
| public override async Task ExecuteAsync(HttpContext context) | ||
| { | ||
| Init(context); | ||
| var createUrl = Options.UserInteraction.CreateAccountUrl; | ||
| var returnUrl = await BuildReturnUrl(context, createUrl.IsLocalUrl()); | ||
|
|
||
| var url = createUrl.AddQueryString(Options.UserInteraction.CreateAccountReturnUrlParameter, returnUrl); | ||
| context.Response.RedirectToAbsoluteUrl(url); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a line here stating that unsupported prompts will cause an authorization request to fail