I’m doing a variant of the _is_collaborators authorization method for a small Collab App I’m writing.
The code is more-or-less unmodified from the original version.
I have a bearer token. It’s being passed by the call. This is the code:
svc_url = get_services()['collab_service'][settings.ENV]['url']
headers = {'Authorization': _get_auth_header(request.user)}
if not context:
return False
url = '%scollab/context/%s/' % (svc_url, context)
res = requests.get(url, headers=headers)
if res.status_code != 200:
return False
res.status_code == 401 after requests.get(…).
Any ideas?