Skip to content
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

Allow arbitrary pushed redirect_uris #1458

Merged
merged 5 commits into from
Nov 4, 2023
Merged

Conversation

josephdecock
Copy link
Member

Spec allows an arbitrary redirect uri to be pushed: https://datatracker.ietf.org/doc/html/rfc9126#name-management-of-client-redire

This is implemented as a new redirect uri validator that is passed the necessary context to determine if redirection is needed.

Question: should this behavior always be enabled, or be opt in?

@brockallen
Copy link
Member

Question: should this behavior always be enabled, or be opt in?

I prefer opt-in. I want people to know they're allowing this.

/// </summary>
public bool IsPushedAuthorizationRequest => PushedAuthorizationReferenceValue is not null;
public AuthorizeRequestType AuthorizeRequestType { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make it overly explicit that it's set to Authorize by default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh, I now see this is used in many places... we can just rely upon the default enum values, I suppose.

@brockallen
Copy link
Member

Let's schedule a call to pair review this, please.

@josephdecock
Copy link
Member Author

This is ready for another review.

// is valid to use a pushed redirect uri that is not
// pre-arranged.
if (context.Client.RedirectUris?.Any() == false &&
!context.Client.RequirePushedAuthorization)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confidential, not require par, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, forgot about this one!

/// Initializes a new instance of the <see cref="StrictRedirectUriValidator" />.
/// </summary>
/// <param name="options"></param>
public StrictRedirectUriValidator(IdentityServerOptions options)
Copy link
Member

@brockallen brockallen Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe optional for backwards compat, and if null then we assume no PAR? The DI folks will love us. Or add a 2nd default ctor with the same behavior.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with the optional parameters here (and similarly in the app auth ctor)

@brockallen brockallen merged commit 983af93 into main Nov 4, 2023
5 checks passed
@brockallen brockallen deleted the joe/par-redirect-uris branch November 4, 2023 01:11
@brockallen
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants