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

First draft of DPoP support #1184

Merged
merged 47 commits into from Mar 13, 2023
Merged

First draft of DPoP support #1184

merged 47 commits into from Mar 13, 2023

Conversation

brockallen
Copy link
Member

@brockallen brockallen commented Feb 17, 2023

First cut of DPoP support. (without a built-in nonce implementation)

Open issues:

  • Need an update for the IdentityModel constants
  • For clients that are configured to requite DPoP do we require the dpop_jkt param on the authorize endpoint? The spec says OPTIONAL, and that flag will still[ require the client to provide one on the token endpoint.
  • We need to think thru the options for replay duration and where those live. Also, this will require the replay cache by default now in DI, which requires an IDistributedCache. (probably related: review ICache<T> and IDistribiutedCache #1059)
  • We need to think thru the options for proof token iat duration validation and where those live. Related: do we want iat vs nonce validation to be a per-client setting? I can see a simple built-in nonce implementation that simply returns a DP protected server timestamp. It'd really not be too diff than the iat validation, but it's server-generated. I can see 2 per-client settings: 1) DPoPProofTokenLifetime (or somesuch), and 2) DPoPValidationType (enum iat vs nonce). Our built-in can do both, I think.
  • Still need a design for nonce validation and/or extensibility.
  • Should we support dpop_jkt with CIBA on the back channel authentication request?
  • look at token renewal proof key/cnf binding logic.
  • Needs docs and samples. (issues opened elsewhere)

Closes: #1116

@brockallen brockallen added enhancement New feature or request needs_docs labels Feb 17, 2023
@brockallen brockallen added this to the 6.3.0 milestone Feb 17, 2023
@brockallen
Copy link
Member Author

@josephdecock and @leastprivilege we should schedule a time to review this first cut, and all together seems to make sense.

@leastprivilege
Copy link
Member

For clients that are configured to requite DPoP do we require the dpop_jkt param on the authorize endpoint? The spec says OPTIONAL, and that flag will still[ require the client to provide one on the token endpoint.

In FAPI 2 the dpop_jkt is mandatory. So this needs a separate Require... setting.

@brockallen
Copy link
Member Author

In FAPI 2 the dpop_jkt is mandatory. So this needs a separate Require... setting.

This seems to say:

if using DPoP, shall support "Authorization Code Binding to DPoP Key" (as required by section 10.1 of [I-D.ietf-oauth-dpop]).

We do support it, so I'm not sure the above is worded such that we need a new client config just for that aspect. Thoughts?

@leastprivilege
Copy link
Member

Ok. I misread that.

@brockallen
Copy link
Member Author

For clients that are configured to requite DPoP do we require the dpop_jkt param on the authorize endpoint? The spec says OPTIONAL, and that flag will still[ require the client to provide one on the token endpoint.

Ok, so I think the answer is that we don't need a require flag for this.

@brockallen
Copy link
Member Author

We need to think thru the options for replay duration and where those live. Also, this will require the replay cache by default now in DI, which requires an IDistributedCache. (probably related: #1059)

I added a new DPoPOptions on the IdentityServer options with the validity duration. I guess we also want a clock skew option as well? This might be necessary even for server-generated nonce values.

@brockallen
Copy link
Member Author

Also added a simple nonce implementation that data protects the server time and uses that for the expiration checking. Still need a flag somewhere to trigger this. It feels like it should be per-client.

@brockallen
Copy link
Member Author

Added MVC sample that works with both the OIDC handler and our access token management library. Yet to add API support.

@brockallen
Copy link
Member Author

brockallen commented Feb 27, 2023

Docs topics:

  • new client config settings (RequireDPoP, DPoPValidationMode, DPoPClockSkew)
  • use of IReplayCache
  • update authZ and token EP docs with new params

@brockallen
Copy link
Member Author

Updates done for the additional logic on token renewal. We can review when available.

@leastprivilege leastprivilege self-requested a review March 13, 2023 14:48
Copy link
Member

@leastprivilege leastprivilege left a comment

Choose a reason for hiding this comment

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

LGTM

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

Successfully merging this pull request may close these issues.

Add DPoP support
2 participants