Configuring hue to work with knox

Knox 1.3.0
Hue 4.5

In my setup, Knox intercepts all the requests to Hue and after successful auth redirects the calls with signed cookie to Hue.

As part of this, I updated following in hue.ini:


I’m able to load the Hue UI with logged in user as “myuser” but it is unable to load any databases (this works normally with other auth backends so permission is not an issue).

Stacktrace in hue logs:
[16/Dec/2019 17:02:14 -0800] middleware INFO Processing exception: <WSGIRequest: POST ‘/jobbrowser/jobs?doAs=myuser’> is not JSON serializable: Traceback (most recent call last):
File “/usr/lib/hue/build/env/lib/python2.7/site-packages/Django-1.11.22-py2.7.egg/django/core/handlers/”, line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/usr/lib/hue/build/env/lib/python2.7/site-packages/Django-1.11.22-py2.7.egg/django/utils/”, line 185, in inner
return func(*args, **kwargs)
File “/usr/lib/hue/apps/jobbrowser/src/jobbrowser/”, line 178, in jobs
‘hiveserver2_impersonation_enabled’: hiveserver2_impersonation_enabled()
File “/usr/lib/hue/desktop/core/src/desktop/lib/”, line 227, in render
return render_json(data, request.GET.get(“callback”), status=status)
File “/usr/lib/hue/desktop/core/src/desktop/lib/”, line 303, in render_json
json = encode_json(data, indent)
File “/usr/lib/hue/desktop/core/src/desktop/lib/”, line 275, in encode_json
return json.dumps(data, indent=indent, cls=Encoder)
File “/usr/lib64/python2.7/json/”, line 251, in dumps
sort_keys=sort_keys, **kw).encode(obj)
File “/usr/lib64/python2.7/json/”, line 209, in encode
chunks = list(chunks)
File “/usr/lib64/python2.7/json/”, line 434, in _iterencode
for chunk in _iterencode_dict(o, _current_indent_level):
File “/usr/lib64/python2.7/json/”, line 408, in _iterencode_dict
for chunk in chunks:
File “/usr/lib64/python2.7/json/”, line 442, in _iterencode
o = _default(o)
File “/usr/lib/hue/desktop/core/src/desktop/lib/”, line 77, in default
return json.JSONEncoder.default(self, o)
File “/usr/lib64/python2.7/json/”, line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <WSGIRequest: POST ‘/jobbrowser/jobs?doAs=myuser’> is not JSON serializable

I do not see any errors in hive server logs.