You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of expected behavior and the observed behavior
If I set up oauth using the AzureV2 provider and enable encryption, setting the access_token cookie fails as the token size is larger than the 4096 bytes max limit. The access_token I get back from azure is ~2,200 bytes. After encrypting it, it becomes ~3,100 and then after tornado is done signing and b64 encoding it, it jumps to ~4,300 bytes. At this point, it just silently fails to set the cookie, and future calls to pn.state.access_token return None as they should.
This is a non-issue when using the Azure (V1) provider and is also a non-issue on either if you disable encryption.
Complete, minimal, self-contained example code that reproduces the issue
panel_app.py
import panel as pn
print(pn.state.access_token)
run using all the appropriate panel cli args to enable authentication.
Screenshots or screencasts of the bug in action
Proposed solution
I tried to look up any documentation about expected max length for the access_token and couldn't find anything helpful, and a couple of links suggesting that there is no max length. My current workaround is to break up the token into it's header/paylod/signature and encrypt and store each separately. The modifications are--
Add a specific _on_auth() to the AzureAdV2LoginHandler class
code seems fairly clunky, so lmk if anyone has any suggestions on making it more concise, or if there is any other way that you can think of getting around this. Happy to submit a PR if you're good with the mods above.
Thanks!
The text was updated successfully, but these errors were encountered:
Apparently most modern browsers still have hard max cookie sizes of about 4096 bytes. The only thing I can suggest we try is to apply some basic compression.
ALL software version info
panel == 0.14.1
python == 3.9.13
bokeh == 2.4.3
Description of expected behavior and the observed behavior
If I set up oauth using the AzureV2 provider and enable encryption, setting the access_token cookie fails as the token size is larger than the 4096 bytes max limit. The access_token I get back from azure is ~2,200 bytes. After encrypting it, it becomes ~3,100 and then after tornado is done signing and b64 encoding it, it jumps to ~4,300 bytes. At this point, it just silently fails to set the cookie, and future calls to pn.state.access_token return None as they should.
This is a non-issue when using the Azure (V1) provider and is also a non-issue on either if you disable encryption.
Complete, minimal, self-contained example code that reproduces the issue
panel_app.py
run using all the appropriate panel cli args to enable authentication.
Screenshots or screencasts of the bug in action
Proposed solution
I tried to look up any documentation about expected max length for the access_token and couldn't find anything helpful, and a couple of links suggesting that there is no max length. My current workaround is to break up the token into it's header/paylod/signature and encrypt and store each separately. The modifications are--
Add a specific _on_auth() to the AzureAdV2LoginHandler class
and modify the access_token property in _state to--
code seems fairly clunky, so lmk if anyone has any suggestions on making it more concise, or if there is any other way that you can think of getting around this. Happy to submit a PR if you're good with the mods above.
Thanks!
The text was updated successfully, but these errors were encountered: