-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: handle jwt cookie vs session user mismatch #388
Conversation
66b4b86
to
b7a5229
Compare
Adds toggle EDX_DRF_EXTENSIONS[ENABLE_JWT_VS_SESSION_USER_MONITORING] to enable the following features: - New custom attributes is_jwt_vs_session_user_check_enabled, jwt_auth_session_user_id, jwt_auth_and_session_user_mismatch, and invalid_jwt_cookie_user_id for monitoring and debugging. - When forgiving JWT cookies are also enabled, user mismatches will now result in a failure, rather than a forgiving JWT.
b7a5229
to
d41ac06
Compare
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.
Generally looks good, I had a couple of questions about error handling.
- add separate methods to find mismatch with successful and failed JWT, to make differences more clear. - add additional values for ``failed_jwt_cookie_user_id`` in the case that the user_id is not found, or the JWT can't be decoded. - typo fix.
@feanil: This is ready for re-review. |
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.
New error checking looks great, thanks for making the update. This looks good to me to land.
Description:
Adds toggle
EDX_DRF_EXTENSIONS[ENABLE_JWT_VS_SESSION_USER_MONITORING]
to enable the following features:
jwt_auth_session_user_id, jwt_auth_and_session_user_mismatch,
and invalid_jwt_cookie_user_id for monitoring and debugging.
will now result in a failure, rather than a forgiving JWT.
This implements #381 (comment).
Merge checklist:
Post merge:
finished.