adomass opened a new issue, #34611:
URL: https://github.com/apache/superset/issues/34611
### Bug description
Enable GLOBAL_ASYNC_QUERIES feature and use any embedded dashboard.
Using superset 5.0
Load the page and you will get 401 UNAUTHORIZED response.
WARNING:root:Failed to add user to db session: Class
'werkzeug.local.LocalProxy' is not mapped
WARNING:root:Failed to add user to db session: Class
'werkzeug.local.LocalProxy' is not mapped
WARNING:superset.common.utils.query_cache_manager:force_cached
(QueryContext): value not found for key 68d2a3488fa8bc378f473740ea4157ef
WARNING:superset.async_events.async_query_manager:Parse jwt failed
Traceback (most recent call last):
File "/app/superset/async_events/async_query_manager.py", line 203, in
parse_channel_id_from_request
return jwt.decode(token, self._jwt_secret,
algorithms=["HS256"])["channel"]
File "/app/.venv/lib/python3.10/site-packages/jwt/api_jwt.py", line 222,
in decode
decoded = self.decode_complete(
File "/app/.venv/lib/python3.10/site-packages/jwt/api_jwt.py", line 167,
in decode_complete
self._validate_claims(
File "/app/.venv/lib/python3.10/site-packages/jwt/api_jwt.py", line 273,
in _validate_claims
self._validate_sub(payload, subject)
File "/app/.venv/lib/python3.10/site-packages/jwt/api_jwt.py", line 300,
in _validate_sub
raise InvalidSubjectError("Subject must be a string")
jwt.exceptions.InvalidSubjectError: Subject must be a string
The root cause is that sub claim is not set on async_access cookie token
[register_request_handlers](https://github.com/apache/superset/blob/2696d3e8004db8e5a3e83a96a3b2cb0b60de327c/superset/async_events/async_query_manager.py#L165):
`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjaGFubmVsIjoiZjc4OTk5ZTUtMjZjYi00ODg5LTgzZDQtMWEyZTE2NGIzNzM2Iiwic3ViIjpudWxsfQ.jWwEk5mHJjUHvCBKKcKayjIF9LNgkVYYxZ_HPenUhBo`
There fore
[parse_channel_id_from_request](https://github.com/apache/superset/blob/2696d3e8004db8e5a3e83a96a3b2cb0b60de327c/superset/async_events/async_query_manager.py#L197C9-L197C38)
throws jwt.exceptions.InvalidSubjectError: Subject must be a string
Embbeded dashboards work when using force reload with GAQ enabled. Also
works with GAQ disabled.
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [ ] I have checked Superset's logs for errors and if I found a relevant
Python stacktrace, I included it here as text in the "additional context"
section.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]