-
Notifications
You must be signed in to change notification settings - Fork 12
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
Open
equist
wants to merge
25
commits into
RockSolidKnowledge:main
Choose a base branch
from
equist:feat/improved-prompt-handling
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
db4fb6f
Nullable improvments for StringExtensions.
equist 642f53c
Corrected prompt_login_should_show_login_page test and added the same…
equist fdcf4e6
Added test for loging in and returning for both prompt and max_age.
equist 09857ef
Added failing tests for letting the login page know prompt/max_age va…
equist 0a2aece
Removing the prompt/max_age parameters from callback endpoint, but ke…
equist e405d4d
prompt=create is only allowed by itself.
equist 1b37db4
Test for combining prompt=create with any additional value.
equist 4a9d229
Added support for prompt=create
equist 18bf5c5
Failing on unsupported prompt modes.
equist d9bd101
Added missing copyright
equist 1ebd460
Changed failing unit test to now ensure that prompt values are kept.
equist 4b2aa69
Fixed copy/paste name error of test.
equist 1266386
Add failing test for when prompt parameter is passed in a request obj…
equist aae2ace
Changed strategy for handling that prompt and/or max_age have been pr…
equist fb9951f
Moved constants from root to asub class.
equist 0bff2af
Added documentation of options.
equist a941d3e
Added unit tests for CreateAccountPageResult
equist a5aa746
Added cancellation token to remove warning.
equist 999d700
Added cancellation token to resolve warning.
equist e8f05af
Added unit test to ensure that AuthorizeEndpointBase handles IsCreate…
equist 56af53e
Added AuthorizeInteractionResponseGenerator tests for prompt=Create
equist d67d000
Added missing copyright.
equist ff5c12c
Added unit tests for IdentityServerApplicationBuilderExtensions
equist c9eecf1
Moved two validation tests from integration tests to unit tests.
equist 0044a73
Added unit tests for processed prompt/max_age.
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
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
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.
Changes to options classes require documentation updates. The UserInteraction options can be found under /reference/options