This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
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.
Update JWT login type to support JWKS, custom sub claim, and encode special chars in user ID #9493
Update JWT login type to support JWKS, custom sub claim, and encode special chars in user ID #9493
Changes from 4 commits
7bd41fa
4ab669d
da2bfb1
d8920fd
3d43b53
a1ebec5
22577bc
a77ebc9
6a52891
66f12d0
e706eb4
987431a
93acad2
c8c4a11
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Does this make a synchronous HTTP call? If so we ideally would do this via a
SimpleHttpClient
or push this into the background.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.
Yes, seems like it makes a synchronous HTTP call. It is also possible to implement the loading and parsing of JWKS without PyJWT, like in
OidcHandler
, then we have more control over the request and caching.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.
Fetching this for every login seems quite inefficient. I wonder if we should do something on start-up (like OIDC). It looks like
PyJWKClient
is quite simple!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.
We already did the fallback to
sub
in the config code, no need to do it again.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.
The issue is that tests don't use the config code but set
hs.config
directly, so without specifying a fallback here, many tests inJWTTestCase
would fail. What do you suggest to solve this?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.
The config code should get run during tests, see:
synapse/tests/unittest.py
Lines 469 to 472 in fe604a0
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.
Were you able to try this again? It should run fine during tests.