Conversation
5cc24c1 to
eb42d36
Compare
|
@jonkoops Do you please have opportunity to review? I will try to review as well, but feedback from you would be welcome if you have a chance! |
|
Yes, I will take a look and review. Currently looking at the last bugs for 26.2 that I want to resolve, after that I am going to start merging in features and deprecations for 26.3. |
|
@sundayScoop can you fix the lint errors though |
eb42d36 to
8d65d02
Compare
|
@edewit just fixed the lint errors, let me know if there's anything else needed |
|
👍 |
graziang
left a comment
There was a problem hiding this comment.
@sundayScoop Thanks, from a DPoP RFC point of view, it’s ok for me. I’ll leave to the others a more js-focused review.
|
@jonkoops Can you please reply here if you have a chance to review in the near future? Otherwise going to merge this without your review. @graziang Thanks for your review! @sundayScoop Thanks again for the PR! We may need also documentation for this feature in the keycloak.js documentation . See this directory https://github.com/keycloak/keycloak-js/tree/main/docs . Probably worth to introduce dedicated section about DPoP and document it here? Besides configuration options, it will be good to document:
|
|
Please hold off on merging this PR until we have done a final patch release. I intend to merge this in for 26.3.0, together with some other work for a feature release. |
@mposolda regarding the crypto API suggestion - there is this check in keycloak-dpop.js: if (typeof crypto === 'undefined' || !crypto.subtle) {
throw new Error('DPoP requires Web Crypto API (crypto.subtle) which is not available in this environment.')
}Were you thinking of explicitly showing a warning message to the user without an error? Or just improving the message in the error being thrown? I realise there's no mention of the https requirement in the error, so that might be good to add. Aside from that I've just finished the requested docs - so nearly there! |
|
We already have places where we detect the Crypto API and throw if it is not found: Lines 1623 to 1625 in fa52139 Lines 1689 to 1691 in fa52139 Lines 1946 to 1948 in fa52139 Keycloak JS relies on the Web Crypto API, and therefore only works in a secure context. Perhaps we can roll up this feature detection into a single utility function that is called in all the places where the API is called, to reduce repetition. |
@sundayScoop I was concerned just about documentation here. It can be good to explicitly mention in the keycloak.js documentation that DPoP would be available just if Crypto API is available. And use some warning/formulation in the docs about this similar to what I've mentioned. For example see some warning in the current keycloak.js documentation https://www.keycloak.org/securing-apps/javascript-adapter#_using_the_adapter (The warning in this section about "Silent check-sso functionality is limited in some modern browsers." ) |
@jonkoops Cool, Thanks! Any ETA when it could be merged approximately? And when you plan 26.3.0 release? |
At most in a couple of weeks. I am currently rather busy with my talk for BackstageCon, so my bandwidth is limited. |
8d65d02 to
fc1530a
Compare
|
@mposolda just added the requested docs. Sorry for the delay - had quite a busy few weeks. Let me know what you think of the docs |
There was a problem hiding this comment.
@sundayScoop Thanks for the documentation! I am approving this PR from my point of view. The merge might be delayed though (See comments above from @jonkoops ), but hopefully we would be able to do it in few weeks
Update: There is the issue in Build guides . Are you able to take a look?
|
Looking now |
fc1530a to
01bd366
Compare
|
@mposolda |
|
@mposolda following some internal testing at my company, we've identified an issue with the current DPoP implementation related to browsers with unsynchronised clocks. In my initial PR comment I noted:
I'd say this is a necessity rather than a nice-to-have. A browser with a skewed clock will produce a DPoP proof that Keycloak rejects, as we observed with the following server-side error: I'd recommend holding off on merging this PR until the |
Closes keycloak#8 Signed-off-by: sundayScoop <[email protected]>
01bd366 to
8bd86ae
Compare
|
Alright I added the timeSkew to the |
|
@mposolda is anything else needed? |
|
@sundayScoop I took a quick look at the PR, and find the implementation generally agreeable. I have a larger review queued up, but I would like to move this work to v27, as there are several deprecations that I need to do for v26 and a lot of code will be removed under v27. I'll keep you posted as I go. |
Add Demonstration of Proof-of-Possession (DPoP) token support as per the RFC, addressing issue #8.
Key Changes
secureFetch()wrapper so developers don't have to deal with DPoP flow management (e.g. new nonce provided)Testing
dpop.spec.tsNotes
Enabling DPoP Example
Closes #8