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

expiry is not cast to int when read from oauth cookie #6895

Closed
vindex10 opened this issue Jun 6, 2024 · 0 comments · Fixed by #7191
Closed

expiry is not cast to int when read from oauth cookie #6895

vindex10 opened this issue Jun 6, 2024 · 0 comments · Fixed by #7191
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@vindex10
Copy link

vindex10 commented Jun 6, 2024

ALL software version info

in the panel master latest source code

Description of expected behavior and the observed behavior

In this line, the cookie is read and base64decoded into bytes, the actual value is a string containing the integer:

expiry = handler.get_secure_cookie('oauth_expiry', max_age_days=config.oauth_expiry)

Stack traceback and/or browser JavaScript console output

Traceback (most recent call last):
  File "/home/vindex10/projects/venv/krillviz/lib/python3.10/site-packages/tornado/web.py", line 1769, in _execute
    result = await result  # type: ignore
  File "/home/vindex10/projects/venv/krillviz/lib/python3.10/site-packages/bokeh/server/views/auth_request_handler.py", line 79, in prepare
    self.current_user = await self.application.auth_provider.get_user_async(self)
  File "/home/vindex10/projects/venv/krillviz/lib/python3.10/site-packages/panel/auth.py", line 1137, in get_user
    if expiry > now_ts and refresh_token:
TypeError: '>' not supported between instances of 'bytes' and 'float'

it only happens when the access_token is not a jwt - which can happen sometime. but for commonly used provider - apparently it doesn't, so was not detected earlier

@philippjfr philippjfr added this to the v1.5.0 milestone Jun 6, 2024
@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants